views:

67

answers:

1

I use Wix to create 2 installers for my application, one for x86 and one for x64. I want to use InnoSetup to create one setup.exe that will conditionally launch the appropriate .msi file. It's failry straightforward to get Inno to launch the appropriate .msi:

[Files]
Source: "App.x86.msi"; DestDir: "{tmp}"; Check: not Is64BitInstallMode
Source: "App.x64.msi"; DestDir: "{tmp}"; Check: Is64BitInstallMode

[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\App.x86.msi"""; Description:    "MyApp"; Check: not Is64BitInstallMode
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\App.x64.msi"""; Description: "MyApp"; Check: Is64BitInstallMode

But my problem is with the Inno GUI wizard. Namely, I don't want it. I want Inno to silently start, choose the .msi, launch it, and go away. No Inno-generated wizard. Is this possible? Is there a better tool to use to accomplish my end goal?

+1  A: 

The InnoSetup FAQ details that since it could be abused it's not planned as a feature This example will have one dialog shown with the install button.

[Setup]
AppName=example
AppVersion=1
DefaultDirName=example
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
[Files]
Source: test.txt; DestDir: C:\;

[Run]
Filename: notepad.exe; Parameters: "C:\test.txt"; Description: MyApp;

If you have the files already uncompressed you could have an install.cmd file that called InnoSetup with the /silent command line parameter.

Or you could create an install.cmd that picks the correct OS based on the environment variable PROCESSOR_ARCHITECTURE.

IF %PROCESSOR_ARCHITECTURE%==x86 then (
notepad test.txt
) else (
notepad test2.txt
)
Robert Love
Thanks. I settled on something similar to this (using the Disablexxx directives). I can't use a separate batch file because one of my requirements is to build a single self-extracting installer capable of choosing and installing either the 32 or 64 bit version. This approach adds one additional wizard step the user must click through, but I think it will do the job.
Mercury821

related questions