我有兩個獨立的JavaFX應用程序,我將其作爲本機Windows exe部署,使用方法here,但安裝選項設置爲true,以便它安裝在C:驅動器中,而不是應用程序數據。由於某些原因,這兩個應用程序都安裝到同一個目錄中,並且都使用相同的卸載文件,這對我造成嚴重的問題。它安裝的目錄是任何先安裝的程序。例如,如果我先安裝Program1,則它們都會安裝到C:/ Program Files/Program1中。如果Program2首先安裝,它們都會安裝到C:/ Program Files/Program2中。他們都在Inno Setup文件中設置了它們的默認目錄,它們是不同的。有人曾經遇到過這個問題嗎?謝謝!Java FX應用程序在同一目錄中安裝
這裏是從Ant構建產生於計劃1
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Program1 with application files
[Setup]
AppId={{fxApplication}}
AppName=Program1
AppVersion=1.4.0
AppVerName=Program1 1.4.0
AppPublisher=My Company
AppComments=Program1FX
AppCopyright=Copyright (C) 2015
;AppPublisherURL=http://java.com/
;AppSupportURL=http://java.com/
;AppUpdatesURL=http://java.com/
DefaultDirName={pf}\Program1
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
DefaultGroupName=My Company
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Program1-1.4.0
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
SetupIconFile=Program1\Program1.ico
UninstallDisplayIcon={app}\Program1.ico
UninstallDisplayName=Program1
WizardImageStretch=No
WizardSmallImageFile=Program1-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "Program1\Program1.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Program1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\Program1"; Filename: "{app}\Program1.exe"; IconFilename: "{app}\Program1.ico"; Check: returnTrue()
Name: "{commondesktop}\Program1"; Filename: "{app}\Program1.exe"; IconFilename: "{app}\Program1.ico"; Check: returnTrue()
[Run]
Filename: "{app}\Program1.exe"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\Program1.exe"; Description: "{cm:LaunchProgram,Program1}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Program1.exe"; Parameters: "-install -svcName ""Program1"" -svcDesc ""Program1"" -mainExe ""Program1.exe"" "; Check: returnFalse()
[UninstallRun]
Filename: "{app}\Program1.exe "; Parameters: "-uninstall -svcName Program1 -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;
和方案2
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Program2 with application files
[Setup]
AppId={{fxApplication}}
AppName=Program2
AppVersion=1.3.1
AppVerName=Program2 1.3.1
AppPublisher=My Company
AppComments=Program2
AppCopyright=Copyright (C) 2015
;AppPublisherURL=http://java.com/
;AppSupportURL=http://java.com/
;AppUpdatesURL=http://java.com/
DefaultDirName={pf}\Program2
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
DefaultGroupName=My Company
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Program2-1.3.1
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
SetupIconFile=Program2\Program2.ico
UninstallDisplayIcon={app}\Program2.ico
UninstallDisplayName=Program2
WizardImageStretch=No
WizardSmallImageFile=Program2-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "Program2\Program2.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Program2\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\Program2"; Filename: "{app}\Program2.exe"; IconFilename: "{app}\Program2.ico"; Check: returnTrue()
Name: "{commondesktop}\Program2"; Filename: "{app}\Program2.exe"; IconFilename: "{app}\Program2.ico"; Check: returnTrue()
[Run]
Filename: "{app}\Program2.exe"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\Program2.exe"; Description: "{cm:LaunchProgram,Program2}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Program2.exe"; Parameters: "-install -svcName ""Program2"" -svcDesc ""Program2"" -mainExe ""Program2.exe"" "; Check: returnFalse()
[UninstallRun]
Filename: "{app}\Program2.exe "; Parameters: "-uninstall -svcName Program2 -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;
由於更改這些以及扎克,這個工作對我很好!我遇到了同樣的問題,並通過爲**名稱**和** id **屬性使用相同的標識符來解決此問題,因爲在大多數情況下,** id **和** name **具有相同的含義。 InnoSetup(.exe)安裝程序有一些例外,這些安裝程序會在[這裏]中解釋(http://www.jrsoftware.org/ishelp/index.php?topic=setup_appid)如果您想要使用ant屬性,您甚至可以使用ant屬性該名稱可以在屬性文件中配置。 –