Windows Installer 1631 Custom Action Error

I am creating msi-installer for the product and I need to run the web url in the browser after installation. I am using WIX 3.5 to create an installer (but this is probably not important). The example I found at http://www.tramontana.co.hu/wix/lesson5.php#5.2 does not work - the installer log says

"Action ended 15:27:30: LaunchBrowser. Return value 1631.".

I saw a lot of messages about this problem on the Internet, but no one provides a solution (someone found the problem in multilingual mode, someone contacted Microsoft to solve this problem).

I can only guess that the problem is somewhere in the security of Windows 7 (I had a problem with it). Maybe the Windows installer is forbidden to run exe files (I tried many other examples with other exe-s, but they all had the same result).

Is there a general solution?

+4
source share
2 answers

I believe the problem was really in UAC security. To grant actinon user administrative permissions, we must make it defragmented, for example:

<CustomAction Id="LaunchBrowser" Directory="TARGETDIR" Impersonate="no" Execute="deferred" ExeCommand="[BrowserExePath] [LaunchingUrl]" Return="check"/> 

And I highly recommend this blog post about user actions - it completely changed my vision of them.

+1
source

Here is what I did to install and uninstall.

At first I also got "Return Value 1631" and spent a lot of time with UAC security, privilege escalation, Impersonate = "yes" and Execute = "deferred", which did not work.

But in the end, it was fixed very simply when I set Directory = "TARGETDIR" and not BinaryKey = "WixCA"

 <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> 
0
source

All Articles