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
Related
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.
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
I have a WIX install program.
When I test my install program on a machine where the old version of the software is running, I get the prompt below.
The problem is that the installer can't manage to close the application. When the new program runs, it complains about the old one running.
Is there a way to forcefully kill the app?
If not, is there some entry in WIX that will require the user to shutdown the application before it will continue installation?
I found the answer here:
WiX <util:CloseApplication> element not working
I made one tweak to the solution in the post above. I kill the application earlier in the install sequence so the window above doesn't appear.
<!-- Code to force termination of running program...MSIExec couldn't do it -->
<Property Id="QtExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /F /IM "$(var.ProductName).exe"'/>
<CustomAction Id="APP.TaskClose" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="APP.TaskClose" After="LaunchConditions"/>
</InstallExecuteSequence>
If you are wondering what "$(var.ProductName).exe" is, I pass the exe name on the commandline because I'm creating several branded versions of the same program. Just substitute your exe name.
And yes, it is safe in this particular intance to do this. There is no data held in memory that could be lost.
You should use the WiX util extension CloseApplication:
http://wixtoolset.org/documentation/manual/v3/xsd/util/closeapplication.html
That should work.
Long term you should get the app integrated with Restart Manager so it will shut down automatically.
I have a WIX Project and a Bootstrapper of WIX.
I am using Reboot property of WIX to prompt for reboot machine after setup complete its installation.
But when i run my msi using Bootstrapper then it did not prompt a message for reboot machine.
below is my code that i am using in Product.wxs file in WIX:-
<Property Id="REBOOT" Value="Force"/>
Now i am using chain of msi in Bootstrapper project below:-
<Chain>
<MsiPackage SourceFile=".\Bonjour.msi" Compressed="yes" />
<MsiPackage SourceFile=".\Security_IDTools.msi" Compressed="yes" />
<MsiPackage SourceFile ="$(var.BiodentifySetUp.TargetPath)" Compressed ="yes" DisplayInternalUI="yes" />
</Chain>
But when my last msi run it did not prompt reboot message?
The REBOOT property does not force a reboot, and in the context you're using it is a Windows Installer property not a WiX property. The REBOOT property tells Windows what behavior should occur when a reboot occurs. You need a ScheduleReboot action in your MSI file if you want a reboot at the end of an MSI install and want to ask for it, or a ForceReboot if you want to just do it, as Nimish says.
There is also the question of why you want to force a reboot in the first place. Windows will reboot if something happens that requires one - there's no need for you to assume that a reboot is required just because an install has finished.
A Reboot may be necessary due to the stupid behavior of events and security in Windows 8 (and even in windows 7). That is the "easiest" way to make sure all of your services have been started correctly. I would expect that as already mentioned would be the best choice so that there is no abort of the bootstrapper in the middle.
Priyanka if you have any plans to continue your installation after reboot then do not use the MSI's reboot prompt with a bootstrapper.
That's because it would effectively abort the bootstrapper and won't give it a chance to resume on reboot if necessary.use <ExitCode Behavior="forceReboot" /> after MsiPackage you want it to restart. After a force reboot, Burn will automatically resume after the reboot and rest of your MSI/Exe would be installed.
But if you dont have any such plans you can go with ScheduleReboot Action in your MSI.
<InstallExecuteSequence>
<ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>
This will tell the MSI package to reboot after successful install.
And make sure to check log for any error.
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