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

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

Related

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 )

Prompt to uninstall older version of APP in WiX

I developed an installer using Wix 3.6 that installs successfully all elements of an application.
Now, each time I give an msi with a higher version, I want the installer to prompt the user to uninstall it. Since now I've tried this:
<Product
Id="*"
Name="!(loc.ProductName)"
Language="3082"
Codepage="1252"
Version="1.0.1"
Manufacturer="$(var.ProductManufacturer)"
UpgradeCode="$(var.UpgradeCode)">
<Property Id="PREVIOUSVERSIONINSTALLED" Secure="yes" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="1.0.0.0" Maximum="99.9.9.9" IncludeMiminum="yes" IncludeMaximum="no" Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
This code successfully uninstalls any previous installed version on my computer. But it doesn't ask the user if he's sure to do so.
What I need is Wix installer to prompt the user saying a message like:
A previous version of your [ProductName] is installed. Do you want to uninstall it? [ Yes | No ] option.
Is there any way to prompt user and check if he really wants to uninstall any previous version?
The Windows Installer Upgrade table has an attribute bit called msidbUpgradeAttributesOnlyDetect that is represented by WiX's UpgradeVersion#OnlyDetect attribute.
When properly authored this causes FindRelatedProducts to set an action property of your choosing with the ProductCode GUID(s) of detected products. It does not pass this off to RemoveExistingProducts for automatic removal though.
While not the typical behavior, there is nothing stopping you from writing some UI that gets triggered when this property has a value. You could ask the user if they want to remove the old version and if yes, set another action property to tell RemoveExistingProducts. (Hint: Author a Upgrade that would never find a product on it's own and hijack it's property to inject the removal. )
If the user says no, you have the choice of aborting the install or continuing the install side by side to a different directory structure. ( Office, Visual Studio et al ).
I found this post useful when solving the same problem. You can use the PREVIOUSVERSIONINSTALLED property you set in the upgrade-tag to open a custom dialog. Do this inside some UI-tags by adding the following code (when using the standard welcome dialog):
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="OldVersionDlg">PREVIOUSVERSIONSINSTALLED</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg">NOT Installed AND NOT PREVIOUSVERSIONSINSTALLED</Publish>
I based my own custom dialog on this Wix tutorial, and ended up with the following code:
<Dialog Id="OldVersionDlg" Width="260" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="No" Type="PushButton" X="132" Y="57" Width="56" Height="17"
Default="yes" Cancel="yes" Text="No">
<Publish Event="EndDialog" Value="Exit">1</Publish>
</Control>
<Control Id="Yes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="Yes">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30">
<Text>A previous version of [ProductName] is currently installed. By continuing the installation this version will be uninstalled. Do you want to continue?</Text>
</Control>
</Dialog>

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.

Wix custom UI for SQL Database installation

This is my very first wix project. I downloaded wix 3.6 rc.
My installation project includes 2 wcf and 1 silverlight projects. Everything works fine with default Wix UI. But now that I need to add sql database to it. It works fine with default values like below:
<Component Id='SqlComponent' Guid='8B72C159-1477-4A58-AFAE-E94D756BFFA6'>
<CreateFolder/>
<sql:SqlDatabase Id='SqlDatabase' Database='master' Server='.'
CreateOnInstall='yes' DropOnUninstall='no' ContinueOnError='yes'>
<sql:SqlScript Id='CreateTable' BinaryKey='CreateTable' ExecuteOnInstall='yes' />
<sql:SqlScript Id='CreateTable1' BinaryKey='CreateTable1' ExecuteOnInstall='yes' />
</sql:SqlDatabase>
</Component>
But I need to present a user interface for sql database path, database name, user name and password, if user and password is not specified then use windows user.
Just to see how to add a custom ui I tried the following:
but it displays the custom ui right away. But I want it to show specifically for sql database installation only.
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Ready to Install</Text>
</Control>
<Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17"
Default="yes" Text="Install">
<Publish Event="EndDialog" Value="Return" />
</Control>
I guess, once I get it to show the custom UI exactly where I want, my next requirement is going to be able to get user input for database path, name, user and password and pass that information to the script. I'm not sure how to do that either.
Read up on the WiX UI extension in the .chm. Choose the dialog set that is most appropriate for your installer. Then you can customize it accordingly. Let's assume you want to customize the WixUI_Advanced dialog set:
Download the WiX source code
Navigate to the source code for the UI extension located in src\ext\UIExtension\wixlib.
Copy and rename the file *WixUI_Advanced.wxs* to something different such as *WixUI_Advanced_Custom.wxs*.
Open the .wxs file and be sure to rename the UI Id to <UI Id="WixUI_Advanced_Custom">.
Add *WixUI_Advanced_Custom.wxs* to your setup project.
Now you can reference your custom dialog set just like you would reference the other dialog sets in the UI extension. But the UI is not quite customized, it just provides the same functionality as the WixUI_Advanced dialog set. To add a new dialog, you need to create a new .wxs using the wix source as an example. Look at any of the dialogs in src\ext\UIExtension\wixlib for help. Then reference your dialog in *WixUI_Advanced_Custom.wxs* by adding and modifying the <Publish> elements to determine when your dialog is shown.
Finally I found an eye opener article on wix here How to add custom UI
After a long struggle to understand how wix works, the above link to codeproject helped me understand. Especially the part that explains creating UI (MyWebUI.wxs in that article) was the life saver.

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.