WIX自定义安装目录

时间:2016-09-30 16:46:17

标签: windows wix windows-installer

我已经看过很多不同时间的问题了,我已经尝试了几乎所有内容来创建用户可配置的安装目录......

我正在使用本地应用数据文件夹,默认为每用户安装,我怀疑这可能会导致我的问题。

以下是一些代码:

目录创建:

<Property Id="INSTALLLOCATION"
              Value="INSTALLDIR" />

    <!--Directory structure-->
    <Directory Id="TARGETDIR"
               Name="SourceDir">
      <!--Move directory creation to custom action-->
      <Directory Id="LocalAppDataFolder">
        <Directory Id="INSTALLDIR"
                   Name="My app">

对话框

 <UI Id="WixUI_Minimal">
  ....
  ....
  <Property Id="WixUI_Mode"
            Value="Minimal" />

  <DialogRef Id="FilesInUse" />
  <DialogRef Id="MsiRMFilesInUse" />
  <DialogRef Id="PrepareDlg" />
  <DialogRef Id="UserExitDialog"/>
  <DialogRef Id="SuccessDialog"/>
  <DialogRef Id="ProgressDialog"/>

  <Publish Dialog="WelcomeDialog"
           Control="Next"
           Event="NewDialog"
           Value="PrepareDlg">1</Publish>

  <Publish Dialog="WelcomeDialog"
          Control="Options"
          Event="NewDialog"
          Value="MyInstallDirDlg">1</Publish>

        <Publish Dialog="MyInstallDirDlg" 
           Control="Next" 
           Event="SetTargetPath"
           Value="[WIXUI_INSTALLDIR]" 
           Order="1">1</Publish>

  <Publish Dialog="MyInstallDirDlg"
           Control="Next"
           Event="DoAction"
           Value="WixUIValidatePath" 
           Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>

  <Publish Dialog="MyInstallDirDlg"
           Control="Next" 
           Event="SpawnDialog" 
           Value="InvalidDirDlg"
           Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

  <Publish Dialog="MyInstallDirDlg" 
           Control="Next"
           Event="NewDialog" 
           Value="VerifyReadyDlg" 
           Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>

  <Publish Dialog="MyInstallDirDlg"
           Control="ChangeFolder"
           Property="_BrowseProperty"
           Value="[WIXUI_INSTALLDIR]"
           Order="1">1</Publish>

  <Publish Dialog="MyInstallDirDlg"
           Control="ChangeFolder" 
           Event="SpawnDialog"
           Value="BrowseDlg"
           Order="2">1</Publish>

  <Publish Dialog="ConfigOptionsDialog"
           Control="Next"
           Event="NewDialog"
           Value="PrepareDlg">1</Publish>
   ....
   ....

参考安装目录

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>

0 个答案:

没有答案