I have a WiX file that includes this snippet:
<CustomAction Id="DownloadCache" FileKey="CACHEDOWNLOADER.EXE" ExeCommand="/v" Execute="deferred" Return="ignore"/>
<UI>
<Dialog Id="ExitDialog" Title="Product Installer" Height="60" Width="250">
...
</Dialog>
<Dialog Id="FatalErrorDialog" Title="Product Installer" Height="60" Width="250">
...
</Dialog>
<TextStyle Id="DefaultFont" FaceName="Arial" Size="10" />
<Property Id="DefaultUIFont" Value="DefaultFont" />
<InstallUISequence>
<Custom Action="DownloadCache" After="ExecuteAction">(NOT Installed) AND (Not REMOVE)</Custom>
<Show Dialog="ExitDialog" OnExit="success" />
<Show Dialog="FatalErrorDialog" OnExit="error" />
</InstallUISequence>
</UI>
<InstallExecuteSequence>
<Custom Action="DownloadCache" After="WriteRegistryValues">(NOT Installed) AND (Not REMOVE)</Custom>
</InstallExecuteSequence>
The issue is, the resulting .MSI does NOT contain an InstallUISequence table.
I went through the tutorial Events and Actions and the above seems correct. I'm definitely missing something here. How can I fix it?
There must be more than meets the eye here. Even the simplest fragment below will generate an InstallUISequence table with the bare minimum actions of ValidateProductID, CostInitialize, FileCost, CostFinalize and ExecuteAction. No actual UI elements per se, but that's another issue.... (Are Dialogs Optional Now??)
<Wix...>
<Product...>
<Package.../>
</Product>
</Wix>
Related
The case is, I want to have a checkbox in a dialog. If the checkbox
is checked I want to create a file and do some other stuff.
I have a custom action which should using the value of the checkbox-property.
Now I try to pass the checkbox value to my CA-Method but it never receives a value,
the variable is present but always empty. I asume the checkbox variable itself
is not present at this point, because session.CustomActionData.ToString() shows:
INSTALLFOLDER=C:\Program Files (x86)\WixTesterSetup\;CHECKBOXProperty=
My Dialog is:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="UserRegDialogUI">
<Property Id="Proceed">proceedbtn</Property>
<Dialog Id="UserRegDialog" Width="400" Height="300" Title="Atled Service Konfiguration">
<Control Id="headerText" Type="Text" X="65" Y="10" Width="350" Height="40" Transparent="yes" Text="Something to Check" />
<Control Id="checkboxLabel" Type="Text" X="58" Y="150" Height="14" Width="141" Transparent="yes" Text="Checkbox Text" />
<Control Id="checkbox" Type="CheckBox" X="60" Y="165" Height="17" Width="120" Property="CHECKBOXProperty" CheckBoxValue="true" />
<Control Id="proceedButton" Type="PushButton" Text="Weiter" Height="20" Width="43" X="349" Y="266">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="cancelButton" Type="PushButton" Text="Beenden" Height="22" Width="50" X="293" Y="266" Cancel="yes">
<Publish Event="EndDialog" Value="Exit" />
</Control>
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="UserRegDialog" Before="ExecuteAction" />
</InstallUISequence>
</Fragment>
</Wix>
And Product.wsx contains:
<Binary Id="CustomActionBinary" SourceFile="$(var.RegistrationInfoCustomAction.TargetDir)$(var.RegistrationInfoCustomAction.TargetName).CA.dll"/>
<CustomAction Id="RegistrationInfoCustomAction" BinaryKey="CustomActionBinary" DllEntry="SaveUserInfo" Execute="deferred" Impersonate="no" />
<CustomAction Id="CustomAction51" Property="RegistrationInfoCustomAction" Value="INSTALLFOLDER=[INSTALLFOLDER];CHECKBOXProperty=[CHECKBOXProperty]" />
<InstallExecuteSequence>
<Custom Action="CustomAction51" Before='InstallFinalize' />
<Custom Action='RegistrationInfoCustomAction' After='CustomAction51'>NOT Installed</Custom>
</InstallExecuteSequence>
I tried to initialize set the property:
<Property Id="CHECKBOXProperty" Value="true" />
In that case it´s always true even if I uncheck the box.
I tried empty value (compiler says the property will be ignored)
May someone tell me a solution?
It looks like you're running your custom action with deferred context and I think this is what's causing your problems. Read through Obtaining Context Information for Deferred Execution Custom Actions. If you put your property in CustomActionData it should then be available.
I would like to alter text in ExitDialog depending on result of an immediate action, executed after InstallFinalize. I have tried to do this with the use of property to be set by the action (ISSUCCEEDED in the snippet below), but as I understand it, installer lost this property after the transition from server to client phase. If so, how this could be done?
<!-- The MyAction sets the property ISSUCCEEDED -->
<CustomAction Id="MyAction" BinaryKey="..." DllEntry="..."/>
<InstallExecuteSequence>
<Custom Action="MyAction" After="InstallFinalize">...</Custom>
</InstallExecuteSequence>
<UI>
<Dialog Id="MyExitDialog" ...>
...
<!-- ISSUCCEEDED is lost by now -->
<Control Id="C1" Type="Text" Hidden="yes" Text="!(loc.Text1)"...>
<Condition Action="show">ISSUCCEEDED</Condition>
</Control>
<Control Id="C2" Type="Text" Hidden="yes" Text="!(loc.Text2)"...>
<Condition Action="show">NOT ISSUCCEEDED</Condition>
</Control>
...
</Dialog>
</UI>
I have following Fragment to define my CustomActions (actually 2 methods in my CA-project)
<Fragment>
<Binary Id="FooAssembly"
SourceFile="Foo.CA.dll" />
<CustomAction Id="Action1"
BinaryKey="FooAssembly"
DllEntry="Action1" />
<CustomAction Id="Action2"
BinaryKey="FooAssembly"
DllEntry="Action2" />
</Fragment>
My Action1 looks like this:
[Microsoft.Deployment.WindowsInstaller.CustomAction]
public static ActionResult Action1(Microsoft.Deployment.WindowsInstaller.Session session)
{
session["value1"] = "some value";
session["value2"] = "some value";
return ActionResult.Success;
}
Now I need to run this CustomAction when my dialog is showing and bind the value value1 to a Edit-control like so:
<Dialog Id="FooDlg">
<Control Id="FooEdit"
Type="Edit"
Text="[value1]"
Property="value1"
Disabled="yes" />
</Dialog>
My InstallUISequence looks like this
<InstallUISequence>
<Show Dialog="FooDlg"
After="CostFinalize" />
</InstallUISequence>
I am using an Edit-control here, because I need some border - which Text is missing - and therefore I need to have the attribute Property filled.
How can I achieve this?
I have solved this by adapting my InstallUISequence like
<InstallUISequence>
<Custom Action="Action1"
After="CostFinalize" />
<Show Dialog="FooDlg"
After="Action1" />
</InstallUISequence>
I'm modifying default FireBreath WiX script to show simple message after installation is complete. Because sometimes it is so quick, user doesn't get a chance to notice it.
I have this wxs file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" ">
<Package ... />
<Upgrade Id="{369b048a-9f97-5e15-8ce3-c983fa5764d3}">
<UpgradeVersion
Property="OLD_VERSION_FOUND"
Minimum="0.0.1" IncludeMinimum="yes"
Maximum="0.3.3.3" IncludeMaximum="yes"
OnlyDetect="no" IgnoreRemoveFailure="yes"
MigrateFeatures="yes" />
</Upgrade>
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize" />
<InstallExecute After="RemoveExistingProducts" />
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
...
</Directory>
<Feature Id="MainPluginFeature" Title="Plugin" Level="1">
<ComponentRef Id="InstallDirComp"/>
<ComponentRef Id="PluginNameDirComp"/>
<ComponentRef Id="CompanyDirComp"/>
<ComponentGroupRef Id="PluginDLLGroup"/>
</Feature>
<UI>
<Property Id="DefaultUIFont">DlgFont10</Property>
<TextStyle Id="DlgFont10" FaceName="Tahoma" Size="10" />
<Dialog Id="CompleteDlg"
Width="370"
Height="270"
Title="Plugin installed">
<Control Id="Description"
Type="Text"
X="50"
Y="70"
Width="220"
Height="80"
Text="Installation complete, return to web browser." />
<Control Id="Finish"
Type="PushButton"
X="180"
Y="243"
Width="56"
Height="17"
Default="yes"
Cancel="yes"
Text="OK">
<Publish Event="EndDialog" Value="Exit" />
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="CompleteDlg" OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="CompleteDlg" OnExit="success" />
</AdminUISequence>
</UI>
</Product>
</Wix>
but when I build it, I get these error messages
Error 2 error LGHT0204 : ICE20: Standard Dialog: 'FilesInUse' not found in Dialog table
Error 3 error LGHT0204 : ICE20: ErrorDialog Property not specified in Property table. Required property for determining the name of your ErrorDialog
Error 4 error LGHT0204 : ICE20: FatalError dialog/action not found in 'InstallUISequence' Sequence Table.
Error 5 error LGHT0204 : ICE20: FatalError dialog/action not found in 'AdminUISequence' Sequence Table.
Error 6 error LGHT0204 : ICE20: UserExit dialog/action not found in 'InstallUISequence' Sequence Table.
Error 7 error LGHT0204 : ICE20: UserExit dialog/action not found in 'AdminUISequence' Sequence Table.
I don't need any other dialogs, only this one. How to fix this? Can I just ignore these messages?
If a package has any dialogs, Windows Installer requires that it have a minimum set to show UI, mostly under error conditions. The ICE20 documentation has the full list.
In my WiX install package I define a property, then define a textbox that uses this property, then pass this property to my custom action. But inside of the custom action I find out that the property has it's default value, not the one I've specified in the textbox. How can I fix that?
<Property Id="DataSource" Value="."/>
<Control Id="DataSourceText" Type="Edit" Text="." Height="17" Width="150" X="200" Y="18" Property="DataSource"/>
then later in the code
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="CreateDatabase" Value="DataSource=[DataSource]" />
<CustomAction Id="CreateDatabase" BinaryKey="Binary1" DllEntry="CreateDatabase" Execute="deferred" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action='SetCustomActionDataValue' After="InstallFiles"/>
<Custom Action='CreateDatabase' After="SetCustomActionDataValue">NOT Installed AND NOT PATCH</Custom>
</InstallExecuteSequence>
Any properties that you intend to modify in the UI sequence and use in the Execute sequence must be Secure Custom Properties.