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

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 )

Related

`<Show Dialog="CustomTextA" OnExit="success" />` does not work

I have the following code in my wxs file:
<UI>
<Dialog Id="CustomTextA"
Width="370"
Height="270"
Title="$(loc.InstallDirDlg_Title)">
<Control Id="NextButton"
Type="PushButton"
X="236"
Y="243"
Width="56"
Height="17"
Default="yes"
Text="$(loc.WixUINext)">
<Publish Event="EndDialog"
Value="Return"><![CDATA[CustomTextA_NextArgs=""]]></Publish>
<Publish Event="NewDialog"
Value="[CustomTextA_NextArgs]"><![CDATA[CustomTextA_NextArgs<>""]]></Publish>
</Control>
....
</Dialog>
<InstallUISequence>
<Custom Action="CustomTextA_SetProperty_EDIT2"
After="CustomTextA_SetProperty_EDIT1" />
<Custom Action="CustomTextA_SetProperty_EDIT1"
After="ValidateProductID" />
<Custom Action="CustomTextA_SetProperty_EDIT3"
After="CustomTextA_SetProperty_EDIT2" />
<Custom Action="CustomTextA_SetProperty_EDIT4"
After="CustomTextA_SetProperty_EDIT3" />
<Custom Action="ERRCA_UIANDADVERTISED"
Before="AppSearch"><![CDATA[ProductState=1]]></Custom>
<Show Dialog="CustomTextA"
OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="CustomTextA"
OnExit="success" />
</AdminUISequence>
</UI>
but CustomTextA dialog is not displayed when the installation finishes successfully, and standard ExitDialog is shown.
What can be wrong in the code?
I am not sure what the customs actions like Custom Action="CustomTextA_SetProperty_EDIT2" for, but I left them to provide the code as it is.
Wix version is 3.11 (Probably something went wrong after upgrading from an earlier Wix version).
Summary: Please try to download the sample below and have a look at it in Visual Studio. Also read the step-by-step description below for how to use it as a template. I would gather all GUI-markup inside the WixUI_MyMondo.wxs file. Be sure to skim the previous answers linked too.
WiX Custom Dialog Sample: I have a WiX custom GUI sample here (just click download). It is a "Hello WiX" kind of thing - intended to be as simple as possible, but no simpler. In other words it is just doing a couple of things.
It copies the standard WiX dialog source markup in the file WixUI_Mondo.wxs and calls the new file WixUI_MyMondo.wxs. It is put next to Product.wxs.
The main Product.wxs file then includes the customized version with <UIRef Id="WixUI_MyMondo" /> (instead of the standard <UIRef Id="WixUI_Mondo" />) allowing the WixUI_MyMondo.wxs file to be changed as desired.
The rest of the dialogs are linked from the WixUIExtension.dll file (as normal).
I always keep all the dialog events and configurations inside WixUI_MyMondo.wxs - meaning that I try to avoid dialog constructs inside Product.wxs.
Please download and check the sample. It is impossible - as far as I can tell - to deduce more from the markup you have provided.
Previous Answers: Here are two previous answers on the issue of WiX GUI. Rather than rewriting the content in a way that could miss your real question, please skim them will you?
General information on Custom WiX / MSI GUI
Changing dialog order
Links: Some further links here on setup GUI. Burn is WiX's setup.exe generator. It can have its own GUI separate from that embedded in MSI files.
Burn: WiX's bootstapper setup.exe generator: WIX Installer with modern look and feel
More on Burn: Removing Default dialogs from MSI

Wix Custom Action Not working in another machine

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.

Starting a second installer WIX

I have recently started creating installers in wix so i'm pretty new. Having a problem, When the user clicks a button i would like a second installer to start using a .exe file. However I cannot get my code to do this, im a bit confused as to which bit of code goes where but i have these three parts:
<Binary Id="HaspInstaller" SourceFile="visual studio 2010\Projects/ExampleInstaller/ExampleInstaller/bin/Debug/HASPUserSetup.exe" />
<CustomAction Id="HaspSetup" BinaryKey="HaspInstaller" ExeCommand="-switch"
Execute="deferred" Return="check" HideTarget="no" Impersonate="no" />
<Control Id="Hasp" Type="PushButton" X="40" Y="60" Width="56" Height="34" Bitmap="yes" Text="HaspImage" >
<Publish Event="DoAction" Value="HaspSetup" />
</Control>
Any help would greatly be appreciated..:)
N
That will not run when you click the button due to the Execute attribute set as deferred. Mark it as immediate and it will run as soon as you click the button.
Deferred is for use when elevation is required and has to be scheduled into the InstallExecute sequence.
Take a look at http://wix.sourceforge.net/manual-wix3/qtexec.htm which is the quiet execute custom action and the page explains nicely how to set it up for both deferred and immediate execution.
Also if that exe file is a bootstrapper for another msi, you will not be able to run it at all due to the fact that you will already be in one MSI transaction. In that case use burn to bundle the different installers into a single-installer user experience.

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.

WiX - Custom Action (after installation) does not run on upgrade

I have created a custom action that gets triggered via UI. It works fine for new install but fails during upgrade. However, if I run a repair from control panel, it then runs fine. I tried capturing msi log but it does not give any clue. Here are the snippets...
UI:
<Control Id="CloseButton" Type="PushButton" X="230" Y="243" Width="66" Height="17" Default="yes" Cancel="yes" Text="&Continue">
<Publish Event="DoAction" Value="ConfigureServer1">1</Publish>
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
Custom Action:
<CustomAction Id="ConfigureServer1" Impersonate="no" Directory="TARGETDIR" Return="asyncNoWait" ExeCommand="[#fileSetupDb] "[ProductVersion]" "[OCISUPGRADE]""></CustomAction>
Sequence for the UI file:
<InstallUISequence>
......
<Show Dialog="FinishedForm" OnExit="success" />
......
</InstallUISequence>
Any clues.... or anything I can try to debug etc.? I tried for a couple of days with no results. I am not a newbie in msi or wix and not an expert either.
I don't completely follow the question but I'll take a guess. When upgrading the "previous version of the product" (the MSI being removed) only has its InstallExecuteSequence run. So the custom action in the old version of the product in the InstallUISequence won't run.
If the question is why the custom action won't run in the new version of the product, then there isn't enough information here. You can look in the verbose log file to see what the result of the custom action with the matching Id.