i have code like this
<Fragment>
<CustomAction Id="IsPrivileged" Error="You should be an adminuser" />
<InstallExecuteSequence>
<Custom Action="IsPrivileged" Before="LaunchConditions">Not AdminUser</Custom>
</InstallExecuteSequence>
<CustomAction Id="install_myfile" FileKey="id_myfile.exe" ExeCommand="/install" Return="check"/>
<InstallExecuteSequence>
<Custom Action="install_myfile" Sequence="5750"/>
</InstallExecuteSequence>
</Fragment>
But installer ignores this fragment. i looked the msi-database with Orca.exe. and i found that in InstallExecuteSequence Table there are no rows with this custom actions. what is the problem? should i bind my custom actions to dialog's controls?
Use CustomActionRef to reference the Fragment into your Product.
Related
I have 2 custom actions in WIX A and B
I need B to execute only after A is finished.
A is an external exe, B is a set of commands which configures A, and therefore cannot execute before A.
Currently I define 2 custom actions like this:
<CustomAction Id='install_exe_action' FileKey='exe' Execute='deferred' Return='check' ExeCommand=' --flags 1'/>
<CustomAction Id='start_service_controller_action' FileKey='exe_service_controller_exe' Impersonate='no' ExeCommand=' /install ' Execute='deferred' Return='check' />
I then have 2 InstallExecuteSequence sections like:
<InstallExecuteSequence>
<Custom Action='install_exe_action' After='InstallFiles'> NOT Installed AND NOT REMOVE </Custom>
</InstallExecuteSequence>
<InstallExecuteSequence>
<Custom Action='start_service_controller_action' After='InstallFiles'> NOT Installed AND NOT REMOVE </Custom>
</InstallExecuteSequence>
How can I get start_service_controler_action to only happen AFTER install_exe_action?
Thanks!
<InstallExecuteSequence>
<Custom Action='install_exe_action' After='InstallFiles'> NOT Installed AND NOT REMOVE </Custom>
<Custom Action='start_service_controller_action' After='install_exe_action'> NOT Installed AND NOT REMOVE </Custom>
</InstallExecuteSequence>
I want do execute many files after InstallInitialize but not deferred, because I can have no admin rights. Till now I used for one file the example of the documentation:
<Property Id="QtExecCmdLine" Value="command line to run"/>
<CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Action="QtExecExample" After="TheActionYouWantItAfter"/>
</InstallExecuteSequence>
But the problem is, that there is only one QtExecCmdLine property and I want to execute more files.
The only way I see is to use the deferred example from the documentation with two custom actions.
If the files you want to run change your system you must run them after InstallInitialize and before InstallFinalize.
You can set the Impersonate attribute to “yes” to run them as user who lunched the installer instead of the System user account
To run multiple executable files after Installinitialize:
1) Create CustomAction for each of them
<Fragment>
<CustomAction Id="MYEXE1"
FileKey="myexe1.exe"
ExeCommand="-u"
Execute="rollback"
Impersonate="yes"
Return="check">
</CustomAction>
<CustomAction Id="MYEXE2"
FileKey="myexe2.exe"
ExeCommand="-i"
Execute="deferred"
Impersonate="yes"
Return="check">
</CustomAction>
</Fragment>
2)Schedule the custom
<InstallExecuteSequence>
<Custom Action="MYEXE1" After="InstallInitialize">
<![CDATA[NOT Installed]]>
</Custom>
<Custom Action="MYEXE2" After="myexe1">
<![CDATA[NOT Installed]]>
</Custom>
</InstallExecuteSequence>
I have two custom actions running two EXE files. But they get extracted at the same time and the processes block each other during install. How do I schedule them one after the other?
<CustomAction Id="StartAppOnExit1"
FileKey="UMIEXE"
ExeCommand=""
Execute="deferred"
Return="asyncNoWait"
Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="StartAppOnExit1"
Before="InstallFinalize">$UMIEXE=3</Custom>
</InstallExecuteSequence>
<CustomAction Id="StartAppOnExit2"
FileKey="Python"
ExeCommand=""
Execute="commit"
Return="check"
Impersonate="no" />
<InstallExecuteSequence>
<Custom Action ="StartAppOnExit2"
After="StartAppOnExit1" >$Python=3</Custom>
</InstallExecuteSequence>
Here is my code, but I seem to be getting an error with what you told.
In product.wxs sequence them one after another and in custom action have a check to validate that the exe is executed and hold the process there only
<Custom Action="FirstCustomAction" After="InstallFinalize">NOT INSTALLED AND NOT REMOVE</Custom>
<Custom Action="SecondCustomAction" After="FirstCustomAction">NOT INSTALLED AND NOT REMOVE</Custom>
in CustomAction
WaitForExit() in process call.
Is it possible to sequence a custom action before "LaunchConditions"?
This is my custom action:
<CustomAction
Id="CA_vcAppRunning"
BinaryKey="vcShowMsg"
DllEntry="IsAppRunning"
Return="check"
Execute="immediate"/>
Sequenced in <InstallExecuteSequence/>
<Custom Action="CA_vcAppRunning" Before="LaunchConditions" />
I tried this, opened the MSI file in Orca and found that my custom action is sequenced at "99".
But when I tried to install, it never got called.
I want to schedule this before LaunchConditions as this custom action is supposed to set a property which is used in the LaunchCondition (if the application is running, exit the installer/updater).
Don't schedule it in before LaunchConditions, schedule it after FindRelatedProducts and then add a second custom action that blocks install based on the results from your first CA.
This is the same method used to prevent downgrading in many tutorials, e.g.
<CustomAction Id="CA_BlockOlderVersionInstall" Error="!(loc.LaunchCondition_LaterVersion)" />
<InstallExecuteSequence>
<LaunchConditions After="AppSearch" />
<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
<![CDATA[NEWERVERSIONDETECTED]]>
</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<LaunchConditions After="AppSearch" />
<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
<![CDATA[NEWERVERSIONDETECTED]]>
</Custom>
</InstallUISequence>
I'm using Wix3. I need to open a web page when the user uninstalls the product.
Any ideas how it can be done?
Thanks.
Here's a sample of the code we use, we don't actually set the URL at compile time, but update properties in the MSI post-build so this might seem a little "over engineered". We use the WiXShellExec CA and have an additional condition so that the webpage is only displayed during uninstall, and not during a major upgrade.
<Fragment>
<Property Id="MyURL"><![CDATA[http://www.blah.blah.blah/]]></Property>
<CustomAction Id="SetOpenURL" Property="WixShellExecTarget" Value="[MyURL]" />
<CustomAction Id="OpenURL" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
<InstallExecuteSequence>
<!-- Launch webpage during full uninstall, but not upgrade -->
<Custom Action="SetOpenURL" After="InstallFinalize"><![CDATA[REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE]]></Custom>
<Custom Action="OpenURL" After="SetOpenURL"><![CDATA[REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE]]></Custom>
</InstallExecuteSequence>
</Fragment>
Add these XML elements somewhere under your <Product> element:
<CustomAction Id="LaunchBrowser"
ExeCommand="explorer.exe http://www.google.com"
Directory="INSTALLDIR"
Return="asyncNoWait" >
REMOVE="ALL"
</CustomAction>
<InstallExecuteSequence>
<Custom Action="LaunchBrowser" After="InstallValidate"/>
</InstallExecuteSequence>
The REMOVE="ALL" condition will make sure the custom action is executed only if the product is being completely removed.
The After="InstallValidate" makes sure that the custom action is executed right after the REMOVE property value becomes known.
The example provided by FireGiant Launch the Internet doesn't work for me but it inspire me to come out my own solution as below.
The condition NOT Installed mean new installation while Installed means it only trigger when uninstall.
<CustomAction Id="LaunchBrowser" Directory="INSTALLDIR" Return="asyncNoWait" ExeCommand="explorer.exe http://www.google.com/" />
<InstallExecuteSequence>
<Custom Action="LaunchBrowser" After="InstallFinalize">Installed</Custom>
</InstallExecuteSequence>
Here is what I did for both install and uninstall:
<Product>
...
<CustomAction Id="LaunchBrowserInstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_install/" />
<CustomAction Id="LaunchBrowserUninstall" Directory="TARGETDIR" Execute="immediate" Impersonate="yes" Return="asyncNoWait" ExeCommand="explorer.exe https://www.example.com/post_uninstall/" />
<InstallExecuteSequence>
<Custom Action="LaunchBrowserInstall" After="InstallFinalize">NOT Installed AND NOT REMOVE</Custom>
<Custom Action="LaunchBrowserUninstall" After="InstallFinalize">REMOVE ~= "ALL"</Custom>
</InstallExecuteSequence>
...
</Product>