Search code examples
wixwindows-installer

How to skip PIDKey requirement for msi, using wix toolset?


I'm creating msi installer, using wix toolset. I need for user inputs, so l used UI Dialog as in documentation: https://www.firegiant.com/wix/tutorial/user-interface/new-link-in-the-chain/

In the Example shown in the link, I removed CDKeyEdit:

<Control Id="CDKeyEdit" Type="MaskedEdit" X="45" Y="159" Width="250" Height="16" Property="PIDKEY" Text="[PIDTemplate]" />

as it is not necessary for my application.

However, installer is showing that key is not valid during installation:

Is there any way to remove the requirement for the PIDKey?


Solution

  •   <Publish Event="ValidateProductID" Value="0">1</Publish>
      <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
      <Publish Event="NewDialog" Value="SetupTypeDlg">ProductID</Publish>
    

    Look for these and remove the first one and change the condition on the last one to empty or 1.

    Shameless plug: Check out my open source tool IsWiX. It provides templates and designers to learn and use WiX faster.

    Tutorials here:

    https://github.com/iswix-llc/iswix-tutorials

    To include a new custom dialog you simply uncomment one line as shown here:

    https://github.com/iswix-llc/iswix-tutorials/blob/master/desktop-application/Installer/DesktopApplication/Code/UI.wxs

    The code for the new dialog is shown here:

    https://github.com/iswix-llc/iswix-tutorials/blob/master/desktop-application/Installer/DesktopApplication/Code/UI-CustomDialog.wxs