Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Newbie issue with custom input

Newbie issue with custom input 2 years, 4 months ago #1046

  • applicationPackaging
I am running WiX version 3.0.5419.0.

I am building an installer for a program that transforms data.  The program reads data from an input directory and writes the transformed data to an output directory.  I want the user to be able to specify the input and output directory during the installation process and have the installer save the values to the registry.

I created an msi installer using WiX.  It uses a modified version of the WixUI_InstallDir that includes an additional configuration dialog with PathEdit controls to accept the user defined values.  When I run my installer I get the following error before my custom configuration dialog opens up:

    DEBUG: Error 2343:  Specified path is empty.

Here is the code I use to handle the user provided input directory (the output directory code is very similar):

I have a Component for the input directory registry entry that references a UI_CONFIG_INPUT_DIR property that holds the user defined entry:

      <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
        <Component Id="InputDirectory"
Guid="c2689487-f89b-419c-a098-bd2d6cccb2ab">
            <RegistryValue Root="HKCU" Key="Software\ACME\DATA PROJECT\Configure" Name="Input_dir" Type="string"
Value="[UI_CONFIG_INPUT_DIR]"/>
        </Component>
      </DirectoryRef>

In my feature I reference the InputDirectory Component:

      <Feature Id="DATA PROJECT " Title="DATA PROJECT handler" Level="1"
ConfigurableDirectory="APPLICATIONROOTDIRECTORY">
        <ComponentRef Id="InputDirectory" />
      </Feature>

The UI_CONFIG_INPUT_DIR is defined and set to a default value of C:\\:

      <Property Id="UI_CONFIG_INPUT_DIR" Value="C:\\" />

In my custom version of the WixUI_InstallDir I have the following Publish commands to handle the user input from a ConfigureDlg dialog I created (see
below):

            <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog"
Value="MyInstallDirDlg" Order="1">1</Publish>
            <Publish Dialog="ConfigureDlg" Control="Next" Event="NewDialog"
Value="VerifyReadyDlg" Order="1">1</Publish>
            <Publish Dialog="ConfigureDlg" Control="Next"
Event="SetProperty" Value="[UI_CONFIG_INPUT_DIR]" Order="1">1</Publish>
            <Publish Dialog="ConfigureDlg" Control="ChangeInputFolder"
Property="_BrowseProperty" Value="[UI_CONFIG_INPUT_DIR]"
Order="1">1</Publish>

The ConfigureDlg includes a PathEdit Control to accept the user input:

<Wix xmlns="schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <Dialog Id="ConfigureDlg" Width="370" Height="270"
Title="!(loc.InstallDirDlg_Title)">
                <Control Id="Next" Type="PushButton" X="236" Y="243"
Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
                <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>

                <Control Id="FolderInputLabel" Type="Text" X="20" Y="60"
Width="290" Height="20" Text="Raw FOQA Input Directory:" />
                <Control Id="FolderInput" Type="PathEdit" X="20" Y="80"
Width="320" Height="18" Property="UI_CONFIG_INPUT_DIR" Indirect="yes" />
                <Control Id="ChangeInputFolder" Type="PushButton" X="20"
Y="100" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
            </Dialog>
        </UI>
    </Fragment>
</Wix>

Thanks in advance for any help,
  • Page:
  • 1
Time to create page: 0.47 seconds

     
    
Home Forum