2014-06-19 78 views
5

所以我一直在爲我的應用程序開發這個安裝程序。我決定將我的GUI更改爲<UIRef Id="WixUI_InstallDir" />。根據我正在閱讀的教程,如果使用該GUI,還需要包含<Property Id="WIXUI_INSTALLDIR" Value="TOP_LEVEL_DIR" />。但是,由於我改變了GUI並添加了這一行,我得到一個錯誤(2343)。我也發佈了下面的MSI日誌,它正在抱怨一個位置?Wix安裝程序錯誤2343

錯誤: MSI(C)(CC:84)[13:27:33:140]:注:1:2343 DEBUG:錯誤2343:指定的路徑是空的。 安裝程序在安裝此軟件包時遇到意外錯誤。這可能表明此軟件包存在問題。錯誤代碼是2343.參數是:,,, MSI(c)(CC:84)[13:27:34:663]:產品:Viewer 1.0 - 安裝程序在安裝此軟件包時遇到意外錯誤。這可能表明此軟件包存在問題。錯誤代碼爲2343的參數是:,,

Action ended 13:27:34: WelcomeDlg. Return value 3. 
MSI (c) (CC:DC) [13:27:34:672]: Doing action: FatalError 
Action 13:27:34: FatalError. 
Action start 13:27:34: FatalError. 
Action 13:27:34: FatalError. Dialog created 
Action ended 13:27:36: FatalError. Return value 2. 
Action ended 13:27:36: INSTALL. Return value 3. 

代碼:

<?xml version='1.0' encoding='windows-1252'?> 
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> 
    <Product Name='Viewer 1.0' Id='*' UpgradeCode='PUT-GUID-HERE' 
    Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Direct'> 
    <Package Id='*' Keywords='Installer' Description="Viewer Installer" 
     Comments='Installer is a registered trademark.' Manufacturer='Direct' 
     InstallerVersion='100' Languages='1033' Compressed='yes' 
     SummaryCodepage='1252' /> 

    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" /> 
    <Property Id='DiskPrompt' Value="1.0 Installation [1]" /> 
    <Property Id="WIXUI_INSTALLDIR" Value="TOP_LEVEL_DIR" /> 

    <Directory Id='TARGETDIR' Name='SourceDir'> 
     <Directory Id='ProgramFilesFolder' Name='PFiles'> 
     <Directory Id='Direct' Name='DMD'> 
      <Directory Id='INSTALLDIR' Name='Viewer'> 

      <Component Id='MainExecutable' Guid='*'> 
       <Shortcut Id="startmenuViewer" Directory="ProgramMenuDir" 
         Name="Viewer" WorkingDirectory='INSTALLDIR' 
         Icon="Viewer.exe" IconIndex="0" Advertise="yes" /> 
       <Shortcut Id="desktopViewer" Directory="DesktopFolder" 
         Name="Viewer" WorkingDirectory='INSTALLDIR' 
         Icon="Viewer.exe" IconIndex="0" Advertise="yes" /> 

       <File Id='EXE' Name='Viewer.exe' DiskId='1' 
        Source='Viewer.exe' KeyPath='yes'> 
       </File> 
       <ProgId Id="DMDCCDAV" Description="Viewer"> 
        <Extension Id="xml" > 
        <Verb Id="open" Argument="&quot;%1&quot;" 
          TargetFile="EXE" /> 
        </Extension> 
       </ProgId> 
      </Component> 

      </Directory> 
     </Directory> 
     </Directory> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
     <Directory Id="ProgramMenuDir" Name="Viewer"> 
      <Component Id="ProgramMenuDir" Guid="*"> 
      <RemoveFolder Id='ProgramMenuDir' On='uninstall' /> 
      <RegistryValue Root='HKCU' 
          Key='Software\[Manufacturer]\[ProductName]' 
          Type='string' Value='' KeyPath='yes' /> 
      </Component> 
     </Directory> 
     </Directory> 

     <Directory Id="DesktopFolder" Name="Desktop" /> 
    </Directory> 

    <Feature Id='Complete' Title='Viewer Installation' 
      Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'> 
    <Feature Id='MainProgram' Title='Viewer Program' 
      Description='The main executable.' Level='1'> 
     <ComponentRef Id='MainExecutable' /> 
     <ComponentRef Id='ProgramMenuDir' /> 
    </Feature> 
    </Feature> 

    <UIRef Id="WixUI_InstallDir" /> 
    <UIRef Id="WixUI_ErrorProgressText" /> 

    <Icon Id="Viewer.exe" SourceFile="Viewer.exe" /> 

    </Product> 
</Wix> 

回答

10

<Property Id="WIXUI_INSTALLDIR" Value="TOP_LEVEL_DIR" />值是您指定爲允許用戶與用戶界面對話框中設置的內容。在這種情況下,您正在將TOP_LEVEL_DIR識別爲您希望用戶設置的目錄的ID,但您沒有將其映射到任何相應的Directory標記。

假設您試圖允許它們更改根安裝目錄,請嘗試將WIXUI_INSTALLDIR的值從TOP_LEVEL_DIR改爲INSTALLDIR

有關更多信息,請參見this reference

+0

好吧,這是有道理的。這確實解決了我的問題。謝謝。現在我試圖使用默認的文件關聯和.net框架包:/ – Kyle