删除时,CustomAction中的NETFRAMEWORK40FULLINSTALLROOTDIR属性为空

时间:2015-09-15 07:49:53

标签: wix

我们正在使用自定义操作在WiX中使用regasm.exe取消注册.dll。自定义操作的条件是仅在REMOVE =“ALL”时执行,即它将在卸载和删除过程中执行。我的自定义操作无法在删除过程中执行。

    <CustomAction Id='SetMyAction'
             Property='MyProperty'
             Value='&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR]\regasm.exe&quot; /s /u &quot;[TestDir]Test.dll&quot;'
             Execute='immediate'/>
   <CustomAction Id="MyProperty" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
             <InstallExecuteSequence>
                <Custom Action="SetMyAction" After="InstallInitialize">REMOVE="ALL" </Custom>
                <Custom Action="MyProperty" After="SetMyAction">REMOVE="ALL" </Custom>
             </InstallExecuteSequence>

In log file, it shows 
Action 12:20:48: SetMyAction.C34534B3_2456_4073_BC06_716E54E09F7D. 
MSI (s) (94:10) [12:20:48:672]: Executing op: CustomActionSchedule(Action=SetMyAction.C34534B3_2456_4073_BC06_716E54E09F7D,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="\regasm.exe" /s /u "C:\Test\Test.dll")
MSI (s) (94:AC) [12:20:48:727]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI2882.tmp, Entrypoint: CAQuietExec
CAQuietExec:  Error 0x80070002: Command failed to execute.
CAQuietExec:  Error 0x80070002: CAQuietExec Failed

这意味着在CustomActionData中未填充[NETFRAMEWORK40FULLINSTALLROOTDIR]属性。

它是否需要管理员权限或在自定义操作中缺少其他内容...

1 个答案:

答案 0 :(得分:0)

我遇到类似的问题,在添加iis时,NETFRAMEWORK40FULLINSTALLROOTDIR为空:WebServiceExtension。

我发现我必须在Product.wxs中使用 <?php error_reporting(0); $array[0] = array("key1" => "valueNew", "key2" => "Array2", "key3" => "value3", "key4" => "value4"); $array[1] = array("key1" => "valuetwo", "key2" => "Array2", "key3" => "value3", "key4" => "value4"); $array[2] = array("key1" => "valueThree", "key2" => "Array2", "key3" => "value3", "key4" => "value4"); $array1[0] = array("key1" => "Array1", "key2" => "Array2", "key3" => "Array3", "key4" => "Array4"); $array1[1] = array("key1" => "Array1", "key2" => "Array2", "key3" => "Array3", "key4" => "Array4"); $array1[2] = array("key1" => "Array1", "key2" => "Array2", "key3" => "Array3", "key4" => "Array4"); for($i=0;$i<count($array);$i++){ $implode[$i]=array_diff($array[$i],$array1[$i]); } $arrayKeys=array_keys($array[0]); ?> <table width="200" border="1"> <tr> <?php for($i=0;$i<count($arrayKeys);$i++){ ?> <th scope="col"><?php echo $arrayKeys[$i]; ?></th> <?php } ?> </tr> <tr> <?php for($i=0;$i<count($arrayKeys);$i++) { ?> <td><?php for($j=0;$j<count($implode);$j++) { echo $implode[$j][$arrayKeys[$i]]."<br>"; } ?></td> <?php } ?> </tr> </table> 明确定义它。

然后正确填充了框架位置。