A Professional or higher project type is needed.
In order to exemplify the procedure on how the create a MSI wrapper, we will use the below example guided by the following steps:
- In Product Details Page under uncheck the "Register product with Windows Installer" option. We don't want the wrapper to appear in "Control Panel"->"Add or Remove Programs" as an installed program.
- In Files and Folders Page add the MSI installer(s) as Temporary Files.
- In the Registry Page create a dummy registry value and a "new value removal" operation that will remove the previously created registry. We need this workaround, because Advanced Installer doesn't support creating an empty install package. If this step is skipped Advanced Installer will display an error dialog at build time.
- Create a vbscript custom action. In the following example, only one msi installer will be launched based on the type of Windows architecture (x86 or x64) :
Function Wrapper() dim x86, x64 dim version64, version86 dim filename1, filename2 'This will contain the full path to the 1st MSI installer. filename1 = Session.Property ("TempFolder") & "\" & "installer86.msi" 'This will contain the full path to the 2nd MSI installer. filename2 = Session.Property ("TempFolder") & "\" & "installer64.msi" 'Based on these properties we will make the installer selection. version64 = Session.Property("VersionNT64") version86 = Session.Property ("VersionNT") 'We create the full command to execute the MSI files. x86 = "msiexec.exe /i " & filename1 x64 = "msiexec.exe /i " & filename2 set Wsh = CreateObject("WScript.Shell") 'If the machine uses Windows 64bits If version64 <>"" then Wsh.Run x64,1,false 'If the machine uses Windows 32bits Else If version86 <> "" then Wsh.Run x86,1,false End If End If End Function
- In Custom Actions Page add the above created custom action as a "New Attached Custom Action", under "InstallExecuteSequence" above "InstallFinalize" action. To do this, from the context menu select "Show Standard Action" -> "Before Finalization" and select the action above "Install Finalize" action. In this case select "InstallIIS".
- In the "Function Name" field write "Wrapper" ( this is the function name from the script ).
- Set this custom action as "Asynchronous execution, do not wait for return" under "Execution properties".
Because this is an Installer wrapper, optionally in Install Parameters Page under "Product Information" the interface can be switched to a limited view.