1

I am trying to provide the user an option to provide a token in form of a URL or browse for a locally present iso image via Wix UI

Here I face 2 problems:

a. When I select option 2, to BrowseFiles, after selecting a file, the BrowseFile Dialog disappears, but option 1 gets selected

b. Property LOCALDISKPATH is not getting reflected on the text field in UI

VMImageTokenUI.wxs

<Dialog Id="VMImageTokenDlg" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)">
                <Control Id="RadioSelectOption" Type="RadioButtonGroup" Property="R_OPTION" Width="13" Height="100" X="50" Y="50">
                    <RadioButtonGroup Property="R_OPTION">
                        <RadioButton Value="PROVIDE_TOKEN" X="0" Y="0" Width="10" Height="17" />
                        <RadioButton Value="PROVIDE_IMAGE" X="0" Y="50" Width="10" Height="17" />
                    </RadioButtonGroup>
                </Control>
                <Control Id="TokenLabel" Type="Text" X="68" Y="54" Width="150" Height="15" TabSkip="no" Text="!(loc.UI_InstallationTokenLabel)" />
                <Control Id="TokenEdit" Type="Edit" X="68" Y="71" Width="230" Height="15" Text="{2048}" Property="INSTALLATIONTOKEN">
                    <Condition Action="disable">R_OPTION="PROVIDE_IMAGE"</Condition>
                    <Condition Action="enable">R_OPTION="PROVIDE_TOKEN"</Condition>
                </Control>
                <Control Id="SelectLabel" Type="Text" X="68" Y="105" Width="150" Height="15" TabSkip="no" Text="!(loc.UI_SelectImageLabel)" />
                <Control Id="ImageFilePath" Type="Edit" X="68" Y="120" Width="230" Height="15" Text="{2048}" Property="LOCALDISKPATH">
                    <Condition Action="disable">R_OPTION="PROVIDE_TOKEN"</Condition>
                    <Condition Action="enable">R_OPTION="PROVIDE_IMAGE"</Condition>
                </Control>
                <Control Id="BrowseBtn" Type="PushButton" X="68" Y="139" Width="56" Height="17" Text="Browse" Property="LOCALDISKPATH">
                    <Publish Event="Reset" Value="1">1</Publish>
                    <Publish Event="DoAction" Value="BrowseFilesCA" Order="1"><![CDATA[1]]></Publish>
                    <Publish Property="LOCALDISKPATH" Value="[LOCALDISKPATH]"><![CDATA[1]]></Publish>
                    <Condition Action="disable">R_OPTION="PROVIDE_TOKEN"</Condition>
                    <Condition Action="enable">R_OPTION="PROVIDE_IMAGE"</Condition>
                </Control>
                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
                    <!--<Publish Event="DoAction" Value="ValidateSelectedPath" Order="1">1</Publish>  
                  <Publish Event="SpawnDialog" Value="ValidationErrorDlg" Order="1000">ValidationErrorText</Publish>-->
                </Control>
                <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
                <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
                    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                </Control>
            </Dialog>

Product.wxs

<Property Id="R_OPTION" Value="PROVIDE_TOKEN" />

<Publish Dialog="VMImageTokenDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
            <Publish Dialog="VMImageTokenDlg" Control="Next" Event="DoAction" Value="ValidateInstallationTokenCA" Order="1">R_OPTION="PROVIDE_TOKEN"</Publish>
            <Publish Dialog="VMImageTokenDlg" Control="Next" Event="DoAction" Value="ValidateDiskImageCA" Order="1">R_OPTION="PROVIDE_IMAGE"</Publish>
            <Publish Dialog="VMImageTokenDlg" Control="Next" Event="SpawnDialog" Value="VMImageInvalidTokenDlg" Order="2"><![CDATA[R_OPTION="PROVIDE_TOKEN" AND ISVALIDINSTALLATIONTOKEN<>"1"]]></Publish>
            <Publish Dialog="VMImageTokenDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="3"><![CDATA[ISVALIDINSTALLATIONTOKEN="1" OR ISVALIDDISKIMAGE="1"]]></Publish>

enter image description here

FIKRIM
  • 19
  • 4
  • MSI GUI has always been limited and buggy. I am in a hurry, but hope these links can help: **`1)`** [MSI GUI](https://stackoverflow.com/questions/52654935/changing-text-color-to-wix-dialogs/52674815#52674815), **`2)`** [Burn GUI](https://stackoverflow.com/questions/52344035/wix-installer-with-modern-look-and-feel/52349744#52349744), **`3)`** [MSI dialog modification sample](https://github.com/glytzhkof/WiXOpenLogFile) (check box to open the log file for the MSI installation). Throwing in [one more link](https://stackoverflow.com/questions/52857361/wix-default-folder-dialog/52861203#52861203). – Stein Åsmul Jun 09 '21 at 16:49
  • There are some update event problems with MSI dialogs (you click something and the rest of the dialog does not update properly). [Here is a workaround from MSI MVP Stefan Kruger](http://www.installsite.org/pages/en/msi/articles/MultiListBox/index.htm). Keep in mind that you might be able to use a custom Burn GUI instead of an MSI GUI - or you can do more from application on launch. This is always easiest for debugging and source control (one source). I have a [github sample somewhat related](https://github.com/glytzhkof/WiXViewLogExperiment) – Stein Åsmul Jun 09 '21 at 16:52

0 Answers0