Мне нужна помощь в понимании того, как я могу добавить внешнюю DLL к моей собственной .exe-компиляции, используя com.zenjava
. Проблема в том, что мне нужно win32com.dll
в качестве одной из моих зависимостей для запуска моего проекта.
Я пробовал этот StackOverflow ответ , но он не работал для меня.
mvn install:install-file -Dfile=../../artefatos/Java Communication API/win32com.dll -DgroupId=win32com.dll -DartifactId=dll -Dversion=2.0.3 -Dpackaging=dll -DgeneratePom=true
Возникает следующая ошибка:
Ошибка установки артефакта 'win32com: dll: dll': не удалось установить артефакт win32com: dll: dll: 2: D: \ Projects\ sentusdesk-project \ desktop \ sentusdesk (Acesso negado)
Можно ли добавить эту DLL-библиотеку в собственный выпуск моего приложения?
My pom.xml:
<build>
<finalName>SentusDesk</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxswt.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>${mainClass}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>Datachamp</vendor>
<mainClass>${mainClass}</mainClass>
<verbose>true</verbose>
<bundler>EXE</bundler>
<nativeReleaseVersion>${project.version}</nativeReleaseVersion>
<permissions>
<permission>all-permissions</permission>
</permissions>
</configuration>
<executions>
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
<execution>
<id>create-native</id>
<phase>package</phase>
<goals>
<goal>build-native</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Мой файл .iss:
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder SentusDesk with application files
[Setup]
AppId={{br.com.sentus.desk}}
AppName=SentusDesk
AppVersion=1.2.18
AppVerName=SentusDesk 1.2.18
AppPublisher=Datachamp
AppComments=SentusDesk
DefaultDirName={pf32}\SentusDesk
DisableStartupPrompt=Yes
DisableDirPage=No
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=No
DisableWelcomePage=No
DefaultGroupName=Datachamp
OutputBaseFilename=SentusDesk
Compression=lzma
SolidCompression=yes
PrivilegesRequired=poweruser
SetupIconFile=SentusDesk\SentusDesk.ico
UninstallDisplayIcon={app}\SentusDesk.ico
UninstallDisplayName=UninstallSentusDesk
WizardImageStretch=No
[Languages]
Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
[Dirs]
Name: "{app}";
Name: "{app}\app";
Name: "{app}\app\config"; Permissions: everyone-full
[Files]
Source: "SentusDesk\SentusDesk.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "SentusDesk\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "SentusDesk\app\*"; DestDir: "{app}\app\"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "SentusDesk\app\config\*"; DestDir: "{app}\app\config\"; Flags: skipifsourcedoesntexist ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full
[Icons]
Name: "{group}\SentusDesk"; Filename: "{app}\SentusDesk.exe"; IconFilename: "{app}\SentusDesk.ico"; Check: returnTrue()
Name: "{commondesktop}\SentusDesk"; Filename: "{app}\SentusDesk.exe"; IconFilename: "{app}\SentusDesk.ico"; Check: returnFalse()
Name: "{userdesktop}\SentusDesk"; Filename: "{app}\SentusDesk.exe"; IconFilename: "{app}\SentusDesk.ico"; Parameters: "SentusDesk.exe"; Comment: "Sentus Desk";
[Run]
Filename: "{app}\SentusDesk.exe"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\SentusDesk.exe"; Description: "{cm:LaunchProgram,SentusDesk}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\SentusDesk.exe"; Parameters: "-install -svcName ""SentusDesk"" -svcDesc ""SentusDesk"" -mainExe ""SentusDesk.exe"" "; Check: returnFalse()
[UninstallRun]
Filename: "{app}\UninstallSentusDesk.exe "; Parameters: "-uninstall -svcName UninstallSentusDesk -stopOnUninstall"; Check: returnFalse()
[Code]
function returnTrue(): Boolean;
begin
Result := True;
end;
function returnFalse(): Boolean;
begin
Result := False;
end;
function InitializeSetup(): Boolean;
begin
// Possible future improvements:
// if version less or same => just launch app
// if upgrade => check if same app is running and wait for it to exit
// Add pack200/unpack200 support?
Result := True;
end;