Wrap an EXE installer inside a WIX msi - wix

I found this article that shows how to call an EXE installer at the end of an installation done with a WIX installer.
Unfortunately, it does not quite work for me: the EXE does not start after the installation completes. Does anyone has a working example? Unless there is something easy to change from Mr. Ryan's example?
Any input would be greatly appreciated!

You can use the WIX v3.6 Bundle concept to handle this. You can read more about it here
http://wix.sourceforge.net/manual-wix3/authoring_bundle_intro.htm
Basically you are packaging your WIX MSI and the EXE into a single WIX bundle package which can be then installed to the target machines.

I also wanted to keep the UI from the MSI so I added this code to start an exe installer for hardware keys. I know it goes against MSI Best Practices but this is the only one I intend on breaking. Hope this helps.
<Property Id="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
I then ran the custom action from a button click. Or you could schedule it to run after InstallFinalize.

Mr. Ryan here :)
in case this is of use:
this is the WiX project I made, to install Report Viewer 2010 using GPO (Group Policy)
http://www.natureireland.com/Downloads/StackOverflow/oRV2010Installer.rar
note: I used WiX version: Windows Installer XML v3.5
regards
sean

Related

Launch Firebird 1.5 installer from WIX

I have been tasked with writing a WIX installer from an application that uses Firebird 1.5. The WIX install process must launch the firebird installer if firebird has not already been installed. Using a custom action I get the firebird installer to launch but end up with error "1607 unable to install installshield scripting runtime". I have searched this error but have not been able to find a resolution.
Here is a snipit of my custom action.
<InstallExecuteSequence>
<Custom Action='LaunchFirebirdsetup' Before='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
<CustomAction Id='LaunchFirebirdsetup' FileKey='Firebird15Setup' ExeCommand='' Return="ignore" Execute="commit" Impersonate="no" />
It might be because you cannot run an MSI install from within an MSI install, I think that's still true even with a Commit custom action. Your IS Script install is an MSI install, so that may be the issue. Launching installs from within installs is always an issue. You should use Burn to launch that Firebird install before installing yours. That's what a Burn bundle is for - prerequsites and associated installs as well as your MSI setup. You could use it to install a standalone ISScript MSI, that's another possibility.
The other issue is that some installs just don't work when installed with no impersonation, which means with the system account. There's no indication that you tried to do it silently, which means that it's running with the system account and may attempt to show UI to the interactive user, and that will fail. This another reason to install it with Burn - it will run as the interactive user.
Looks like bootstrapping (burn) is the solution.
Took me a while to get it but after getting it to run, it makes sense I guess.
Instead of running an installer exe you could use merge modules. For instance the Firebird 1.5 Merge Modules from MWA Software. Modules, installation instruction and source for the merge modules are freely available.

MSI Installer: Help running a UI based EXE with a CustomAction from a service based installer

I have created a MSI installer package using Wix Toolset 3.8 that is run by a third party installer service running under the "SYSTEM" account. My issue is that when trying to launch and run an installed executable from my MSI installer using a custom action, it also runs under the SYSTEM account instead of the administrator account that is currently logged in. I have spent hours researching on the net and from what I have read, specifying Impersonate="yes" will run that particular custom action under the account that launched the installer, but there lies the issue. Since the third party installer service is running from the SYSTEM account, specifying Impersonate="yes" would just run the custom action under the SYSTEM account as well correct? At least that's what my tests have shown. A little bit of background on my MSI installer:
InstallScope="perMachine"
<CustomAction Id="StartAction"
Directory="FOLDER"
ExeCommand ='cmd.exe /c start MYEXE.exe /tray'
Execute="immediate"
Impersonate="yes"
Return="check"/>
<InstallExecuteSequence>
<Custom Action='StartAction' Before='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
I have tried both "deferred" and "immediate" for Execute as well as setting "Impersonate" to both yes and no. Is there any way to make this work? I thought about using the runas command but I wouldn't know the password of the user account that initiated the install.
Thanks!
What is the EXE file doing? Do you have control of the application so you can move the logic from that external EXE into the main application's launching logic?
Other than that you can register such an EXE file to run once per user via ActiveSetup. You can also find another answer from me here.
Here is one more link to an explanation of ActiveSetup (I prefer the one above): http://www.ewall.org/tech/msi/self-healing
Also see these answer here: Stopping MSI from launching an EXE in the SYSTEM context

How to including Microsoft Hotfix in our Wix based installers?

We need to deliver Hotfix KB982638 to our clients due to a requirement in our products. Our installers are based on WIX.
How can we launch Hotfix KB982638 from our installers, at the end of installation?
What we tried:
We tried to launch its .exe from within our .msi, but it started waiting to finish our msi process, which was actually waiting for hotfix to finish its process and so both halted.
Here is the code:
<Binary Id="NDP40_x64" SourceFile="D:\ApBuild\src\bpf\extras\bin\NDP40-KB982638-x64.exe" />
<CustomAction Id="NDP40_x64_install" Return="ignore" Execute="deferred" BinaryKey="NDP40_x64" ExeCommand=" " />
<InstallExecuteSequence>
<Custom Action="NDP40_x64_install" After="InstallFiles"><![CDATA[Not REMOVE]]></Custom>
</InstallExecuteSequence>
We also tried to launch it from a Bootstrapper (setup.exe) while turning off Hotfix restart option and enabling Bootstrapper's option with Defr attribute, but in this case, if system is restarted, installation of Hotfix also restarts and so a loop is created.
Any help would be greatly appreciated.
Thanks and best regards
Farrukh
Schedule your CA launching the hotfix after InstallFinalize. It should not wait for your installation to finish.
Ok, so I was able to solve it. The Hotfix installer itself installing *.msp files and we can't launch these from out msi installer, it hangs always.
Solution is to pack it with Setup.exe (bootsrapper application ) and installs before launching the msi.
So I launched Hotfix while passing parameter to not to restart until it finished and then I launched the msi which has a scheduled restart custom action.
Thanks a bunch guys
Farrukh

Uninstall add-on setup when uninstall the Main setup using Wix

I am using wix in my installer,
I need to uninstall add-on Setup while uninstall the Main setup,
I am using the below code in Main setup wix,
<CustomAction Id="UNINSTALL_ADDON" Return="asyncNoWait" Execute="immediate" ExeCommand="msiexec.exe /x [add-onProductID] /qn” Property="add-onProductID" />
Below code in InstallExecute Table
<Custom Action="UNINSTALL_ADDON" Sequence="1282">(REMOVE="ALL")</Custom>
I am using the below property
<Property Id=" add-onProductID" Value="NULL" />
I have read the add-on Property Id from registry and pass it set to add-onProductID using CustomAction while uninstall the main setup.
This won’t help. Could you please help me to solve the issue?
You cannot install or uninstall another MSI during InstallExecuteSequence because Windows Installer doesn't support simultaneous install processes.
A solution is to make sure that your custom action is scheduled after InstallFinalize action (it's sequence is greater than InstallFinalize).

How to execute Wix custom action after installation?

I am using Wix3 to install WCF service to IIS.
How can I use my custom action (c#) function after installation completed? i.e. I need to open installed web.config file and replace hostname with real one.
Any ideas?
You can schedule it after InstallFinalize action in InstallExecuteSequence.
There is a sequence of Actions in Windows Installer. The WiX tutorial has a good section on events (and is a great resource anyway).
A typical example of getting something to run after InstallFinalize is to get the installed app to start.
<InstallExecuteSequence>
<Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
Why would you:
1) Need a custom action?
2) Do it after the install instead of during the install?
WiX has a built-in extension for handling what you are trying to do:
XmlFile Element (Util Extension)
It will update your XML after the file has been installed and handle rollback scenarios as well.
What you will have to write a CA for though is reading the XML value back into a property ti handle repair and upgrade situations. Read:
The WiX toolset's "Remember Property" pattern.