I'm seeing some odd behavior from WiX which is leaving me with a headache.
Business Rule: Allow user to override install directory. Allow user to override configuration file installation directory (use install directory as default path set prior).
The Dialog flow is as follows (markup below): WelcomeDlg->InstallDirDlg->LogConfigDlg
<UI Id="MyWixUI_InstallDir">
<UIRef Id="WixUI_InstallDir" />
<!--Add default dialogs: BrowseDlg, DiskCostDlg, InstallDirDlg, InvalidDirDlg, LicenseAgreementDlg, WelcomeDlg, VerifyReadyDlg, etc.-->
<!--<DialogRef Id="AppConfigDlg" />-->
<!-- Override the next and back buttons on the WelcomeDlg and InstallDirDlg to skip the License agreement page of the installer -->
<Publish Dialog="WelcomeDlg" Control="Next" Event="DoAction" Value="regSetINSTALLDIR" Order="1">PREVIOUSINSTALLFOLDER</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">NOT Installed</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="SetLOGCONFIGDIR" Order="2">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="regSetLOGINSTALLDIR" Order="3">PREVIOUSLOGINSTALLFOLDER</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="LogConfigDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="LogConfigDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg"></Publish>
<Publish Dialog="LogConfigDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg"></Publish>
On 'InstallDirDlg' Next I want to do a few things. First of which is pass the 'path' entered into the 'LOGCONFIG_DIR' property...
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="SetLOGCONFIGDIR" Order="2">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<CustomAction Id="SetLOGCONFIGDIR" Property="LOGCONFIG_DIR" Value="[TESTSAVVY_SERVICES]" />
<!--Required for InstallDirDlg-->
<Property Id="WIXUI_INSTALLDIR" Value="TESTSAVVY_SERVICES" />
<!--Required for LogConfigDlg-->
<Property Id="LOGCONFIG_DIRECTORY" Value="LOGCONFIG_DIR" />
Next is check for a registry value for the LOGCONFIG_DIR, this logic works perfectly....
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="regSetLOGINSTALLDIR" Order="3">PREVIOUSLOGINSTALLFOLDER</Publish>
<CustomAction Id="regSetLOGINSTALLDIR" Property="LOGCONFIG_DIR" Value="[PREVIOUSLOGINSTALLFOLDER]" />
<Property Id="PREVIOUSLOGINSTALLFOLDER">
<RegistrySearch Id='LOGCONFIG_DIRRegSrch' Type='raw' Root='HKLM' Key='Software\[Manufacturer]\[ProductName]' Name='LOGCONFIG_DIR' />
</Property>
And lastly navigate to the next dialog window. So the problem is with 'Publish - Event="DoAction" Value="SetLOGCONFIGDIR"'. The directory doesn't reflect what the user put in the InstallDirDlg unless the user presses the 'back' button in the 'LogConfigDlg' and then presses 'next' for a second time on 'InstallDirDlg'.
Why isn't this action being fired the first time the user pressed 'next' from the 'InstallDirDlg', as stated above the user has to go back to that page and press next again? Any ideas would be greatly appreciated.
It's doubly odd that the other action, which is set up pretty much the same way, works just fine when a registry key exists.
UPDATE
Below I'm including the log section when navigating to the next dialog window 'LogConfigDlg'.
Log for when registry key exists ('regSetLOGINSTALLDIR'), this works...
Info 2898.For WixUI_Font_Title textstyle, the system created a 'Tahoma' font, in 0 character set, of 14 pixels height.
Action 13:56:36: InstallDirDlg. Dialog created
MSI (c) (18:20) [13:56:38:182]: Doing action: WixUIValidatePath
MSI (c) (18:20) [13:56:38:183]: Note: 1: 2205 2: 3: ActionText
Action 13:56:38: WixUIValidatePath.
Action start 13:56:38: WixUIValidatePath.
MSI (c) (18:20) [13:56:38:202]: Creating MSIHANDLE (3) of type 790542 for thread 27680
MSI (c) (18:34) [13:56:38:234]: Invoking remote custom action. DLL: C:\Users\WESLEY~1.MUR\AppData\Local\Temp\MSI23C8.tmp, Entrypoint: ValidatePath
MSI (c) (18!E4) [13:56:38:242]: Creating MSIHANDLE (4) of type 790541 for thread 13796
MSI (c) (18!E4) [13:56:38:243]: PROPERTY CHANGE: Adding WIXUI_INSTALLDIR_VALID property. Its value is '1'.
MSI (c) (18!E4) [13:56:38:243]: Closing MSIHANDLE (4) of type 790541 for thread 13796
MSI (c) (18:34) [13:56:38:244]: Closing MSIHANDLE (3) of type 790542 for thread 27680
Action ended 13:56:38: WixUIValidatePath. Return value 1.
MSI (c) (18:20) [13:56:38:246]: Doing action: regSetLOGINSTALLDIR
MSI (c) (18:20) [13:56:38:246]: Note: 1: 2205 2: 3: ActionText
Action 13:56:38: regSetLOGINSTALLDIR.
Action start 13:56:38: regSetLOGINSTALLDIR.
MSI (c) (18:20) [13:56:38:247]: PROPERTY CHANGE: Modifying LOGCONFIG_DIR property. Its current value is 'C:\TestSavvyService\'. Its new value: 'C:\TestSavvyService\hiwes'.
Action ended 13:56:38: regSetLOGINSTALLDIR. Return value 1.
Action 13:56:38: LogConfigDlg. Dialog created
MSI (c) (18:20) [13:56:40:356]: PROPERTY CHANGE: Modifying LOGCONFIG_DIR property. Its current value is 'C:\TestSavvyService\hiwes'. Its new value: 'C:\TestSavvyService\hiwes\'.
Log for when registry key does not exist. 'SetLOGCONFIGDIR' should run in both cases; however, as we can see it's not...
Info 2898.For WixUI_Font_Title textstyle, the system created a 'Tahoma' font, in 0 character set, of 14 pixels height.
Action 13:58:51: InstallDirDlg. Dialog created
MSI (c) (2C:4C) [13:58:54:966]: PROPERTY CHANGE: Modifying TESTSAVVY_SERVICES property. Its current value is 'C:\TestSavvyService\'. Its new value: 'C:\TestSavvyService\temp\'.
MSI (c) (2C:4C) [13:58:55:092]: Note: 1: 2727 2:
MSI (c) (2C:4C) [13:58:55:092]: Doing action: WixUIValidatePath
MSI (c) (2C:4C) [13:58:55:092]: Note: 1: 2205 2: 3: ActionText
Action 13:58:55: WixUIValidatePath.
Action start 13:58:55: WixUIValidatePath.
MSI (c) (2C:4C) [13:58:55:098]: Creating MSIHANDLE (3) of type 790542 for thread 27468
MSI (c) (2C:4C) [13:58:55:118]: Invoking remote custom action. DLL: C:\Users\WESLEY~1.MUR\AppData\Local\Temp\MSI3A92.tmp, Entrypoint: ValidatePath
MSI (c) (2C!04) [13:58:55:126]: Creating MSIHANDLE (4) of type 790541 for thread 16900
MSI (c) (2C!04) [13:58:55:127]: PROPERTY CHANGE: Adding WIXUI_INSTALLDIR_VALID property. Its value is '1'.
MSI (c) (2C!04) [13:58:55:127]: Closing MSIHANDLE (4) of type 790541 for thread 16900
MSI (c) (2C:4C) [13:58:55:128]: Closing MSIHANDLE (3) of type 790542 for thread 27468
Action ended 13:58:55: WixUIValidatePath. Return value 1.
Action 13:58:55: LogConfigDlg. Dialog created
Action 13:58:58: CancelDlg. Dialog created