2016-08-16 37 views
0

我運行一個自定義操作,並得到以下錯誤消息:維克斯安裝程序:錯誤特林運行從一個按鈕,點擊自定義操作時 - 此安裝所需的DLL來完成無法運行

錯誤1723 。此Windows Installer軟件包存在問題。無法運行此安裝所需的DLL。聯繫您的支持人員或軟件包供應商。操作CheckLicenseFileExistsCA,輸入:CheckLicenseFileExists,庫:C:\ Users \ dafna \ AppData \ Local \ Temp \ MSI3395.tmp MSI(c)(E8:04)[19:42:28:921]:產品:ReSecServer - 錯誤1723.此Windows安裝程序包存在問題。無法運行此安裝所需的DLL。聯繫您的支持人員或軟件包供應商。行動CheckLicenseFileExistsCA,條目:CheckLicenseFileExists,庫:C:\用戶\ Dafna先生\ AppData的\ \ MSI3395.tmp

我試圖搜索谷歌的解決方案,但沒有奏效了本地的\ Temp,我可能失去了一些東西.. 。

public class CutomActions 
    { 
     [CustomAction] 
     public static ActionResult CheckLicenseFileExists(Session session) 
     { 
      try 
      { 
       var filename = Path.Combine(session["LICENSEFILE_DIR_PATH"], "license.dat"); 

       var exists = File.Exists(filename); 
       if (exists) 
       { 
        session["LICENSE_FILE_PATH_VALID"] = "1"; 
       } 
      } 
      catch (Exception ex) 
      { 
       return ActionResult.Failure; 
      } 

      return ActionResult.Success; 
     } 

Here are the relevant lines: 

<CustomAction Id='CheckLicenseFileExistsCA' BinaryKey='ServerInstallerCustomActions.CA' DllEntry='CheckLicenseFileExists' Execute="immediate" Return="check" /> <Binary Id='ServerInstallerCustomActions.CA' SourceFile='$(var.ServerInstallerCustomActions.TargetDir)\ServerInstallerCustomActions.dll' /> 


<Control Type="PushButton" Id="BrowseLicense" Width="75" Height="17" X="251" Y="101" Text="{\VSI_MS_Sans_Serif13.0_0_0}Browse" TabSkip="no"> 
     <Publish Property="_BrowseProperty" Value="LICENSEFILE_DIR_PATH" Order="1">1</Publish> 
     <Publish Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish> 
     <Publish Event="DoAction" Value="CheckLicenseFileExistsCA">1</Publish> 
     <Publish Property="TEMP_VERIFIED" Value="[LICENSE_FILE_PATH_VALID]">1</Publish> 
     <Publish Property="LICENSE_FILE_PATH_VALID" Value="[TEMP_VERIFIED]" /> 
    </Control> 

還有一個配置文件(在自定義操作項目):

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="false"> 
    <supportedRuntime version="v4.0" /> 
    </startup> 
</configuration> 
+0

即使移動的動作後,在InstallExecuteSequence運行,我得到了同樣的錯誤 – Dafna

回答

2

當你建立你的自定義操作的項目,應該有運行「MakeSfxCA.exe一個後生成事件運行「其輸出<ProjectTargetName>.CA.dll < - 這是你想要的東西與二進制代碼,而不是從自定義操作項目

,所以你應該使用輸出的dll包括:

<Binary Id='ServerInstallerCustomActions.CA' SourceFile='$(var.ServerInstallerCustomActions.TargetDir)\ServerInstallerCustomActions.CA.dll' /> 
+0

謝謝!我的主要錯誤是我創建了一個基本的dll項目,而不是一個自定義操作類型的特定項目,所以我沒有創建* .CA.dll – Dafna