2016-08-16 21 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

相关问题