Wix Custom Action Not working in another machine - wix

i have created a custom action for getting sites from IIS server.when i run it in my local machine it's working perfectly.but when i run it in another machine it's not working.
locator for custom action
<"Binary Id ="IisManager" SourceFile="$(var.SourceDir)\bin\CustomActions.CA.dll"/>
("used for foarmat this)
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_Mondo"/>
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="IisSettings" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="IisSettings" Order="3">LicenseAccepted = "1"</Publish>
<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="IisSettings">1</Publish>
<InstallUISequence>
<Custom Action="GetIISWebSites" After="CostFinalize" Overridable="yes">NOT Installed</Custom>
<Custom Action="GetIISAppPools" After="CostFinalize" Overridable="yes">NOT Installed</Custom>
</InstallUISequence>
</UI>
have i done something wrong? working only in my machine...

Your custom action is crashing because it's referencing a COM class that is not registered on the other machine. Apparently that CLSID belongs to Microsoft.ApplicationHost.WritableAdminManager and the ServerManager managed API, so if they are not present on the target machine your code will fail. A web search for -CLSID {2B72133B-3F5B-4602-8952-803546CE3344- may get you some more info, but this isn't a WiX or Windows Installer issue as far as I can tell.

Running Setup file with Administrative privileges resolved the issue.
CMD ->>Run As administrator -> Go To setup file and Run it.

Related

Prevent downgrading from a bundle

before I would just use 1 wxs project file to install my app. This would uninstall all previous versions before installing.
Now I have added a bundle and it no longer works. If I change the setup file like adding another file or registry setting and attempt install it will create another entry in my program and features list.
How can i get the same action/behavior from a bundle?
This snippet is what is inside my Product wxs file:
<MajorUpgrade
AllowDowngrades="no"
AllowSameVersionUpgrades="no"
IgnoreRemoveFailure="no"
DowngradeErrorMessage="loc.NewerVersionInstalled"
Schedule="afterInstallInitialize"/>
<InstallUISequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWPRODUCTFOUND</Custom>
</InstallUISequence>
<CustomAction Id='PreventDowngrading' Error='Newer version already installed' />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONROOTDIRECTORY" />
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish
Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
</Publish>
</UI>
thanks

WiX created wizard launches the application but doesn't close itself

I would appreciate your help.
I have an installer made by WiX3.8. I needed to start application after having fulfiled installation. I found this HowTo.
In a word my application is launched, but I still have instalation wizard working. And if I press finish again the app launches again too.
So, there are two part of my wixfile:
I have CustomAction
<Property Id="WixShellExecTarget" Value="[#file19_launcher]" />
<CustomAction Id="LaunchApplication" Execute="immediate" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
and ExitDialog in a ui section:
<UI Id="GoWixUI_InstallDir">
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication" Order="1">NOT Installed</Publish>...</UI>
Please give me any suggestions you have on it.
Thanks.
Ok. I was forced to create my own Finish Dialog and add sequence of actions for finish button. But if someone knows why it doesn't work as it was mentioned, please welcome )

WiX custom action by platform

I need to create a checkbox to install drivers after installation of program (just like run program checkbox). Additional problem is that driver depends on platform of system. I'm trying to do it like that:
<CustomAction Id="RunProgram" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]Application.exe" Return="asyncNoWait"/>
<CustomAction Id="RunDriver64" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]driver/Installer_x64.exe" Return="asyncNoWait"/>
<CustomAction Id="RunDriver32" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]driver/Installer_x86.exe" Return="asyncNoWait"/>
<InstallExecuteSequence>
<Custom Action="RunDriver64" After="InstallFinalize">'$(var.Platform)' != 'x64'</Custom>
<Custom Action="RunDriver32" After="InstallFinalize">'$(var.Platform)' == 'x64'</Custom>
</InstallExecuteSequence>
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="2" Event="DoAction" Value="RunProgram">
WIXUI_EXITDIALOGOPTIONALCHECKBOX
</Publish>
</UI>`
but it doesn't work. Error message:
Error 1 ICE03: Bad conditional string; Table: InstallExecuteSequence, Column: Condition, Key(s): RunDriver64 F:..path..\Product.wxs 26 1 ..project name..
Also my solution is not perfect, as I'm running there a action I don't realy want 'RunProgram', but I couldn't create empty action. Any suggestions, how can I do that?
Thanks
You'll need to wrap it in CDATA
Try <![CDATA[NOT(VersionNT64)]]> and <![CDATA[(VersionNT64)]]> instead of '$(var.Platform)' != 'x64' and '$(var.Platform)' == 'x64'

Executing a custom action that requires elevation after install

I have the following WiX snippet:
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="StartAppOnExit"
FileKey="Configurator.exe"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="Configure initial settings" />
<UI>
<Publish Dialog="ExitDialog"
Control="Finish"
Order="1"
Event="DoAction"
Value="StartAppOnExit"
>WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
Basically on the exit dialog I display a box that says: launch application. Note: this application requires elevation. This all works fine except for a snag. If UAC is enabled it seems that the MSI mucks around with the user token and strips its groups, so when it tries to launch the application that requires elevation it is no longer an option.
How do I string this together to work?
I tried chucking an Impersonate="no", but it's too late at that point for this to work.
The UI sequence is running as a limited user, and it launches applications with a call to CreateProcess. If you use something like a WixShellExec with [WixShellExecTarget] instead, it will act like Explorer and show a UAC prompt if the target requires elevation. Or you could modify your Configurator.exe to allow being launched without elevated privileges, detect that case, and relaunch itself with elevated privileges.
For example, this should work:
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="StartAppOnExit" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="check" Impersonate="yes"/>
<Property Id="WixShellExecTarget" Value="[#Configurator.exe]"/>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Configure initial settings" />
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
FYI, Immediate custom actions are ALWAYS impersonated (i.e. they always run as the user who executes the MSI).
I like Michael Urman's idea regarding making your Configurator.exe handle the elevation issue.
I wonder if you could also just include a manifest in your EXE so that the OS knows elevation is always required.

How do I execute file installed by merge module?

I am using WIX and have successfully used a custom action to execute installed file at the end of installer like this:
<CustomAction Id="LaunchAfterInstall" FileKey="foobar.exe" ExeCommand="parameters" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION"/>
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Foobar." />
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchAfterInstall">WIXUI_EXITDIALOGOPTIONALCHECKBOX</Publish>
</UI>
This works well when foobar.exe is in a component in the same wxs file. However what I really want is to execute a file that is installed by a merge module. How do I do this?
I can make changes in the merge module, if this helps things.
I changed the action to solve my problem:
<CustomAction Id="LaunchAfterInstall" Directory="INSTALLLOCATION" ExeCommand="[INSTALLLOCATION]\foobar.exe" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
You can also open the Merge Module in Orca or your MSI after the build is complete (i.e. the Merge Module has been merged in) and look up the File.Id. Then use the File.Id in the CustomAction.
Ideally though the MSI shouldn't refer to content inside the Merge Module since Merge Modules are supposed to be independent. I appreciate it doesn't always work out that way. :)