Wix-在回滚期间调用自定义操作
我们有一个自定义操作,必须在文件删除之前的回滚期间执行。我们如何添加一个特定的自定义操作作为回滚过程中的第一步执行 我们有下面的代码,但它不工作Wix-在回滚期间调用自定义操作,wix,rollback,Wix,Rollback,我们有一个自定义操作,必须在文件删除之前的回滚期间执行。我们如何添加一个特定的自定义操作作为回滚过程中的第一步执行 我们有下面的代码,但它不工作 <CustomAction Id="Delete_Directory_Rollback" BinaryKey="UnifiedAgentCustomActions.dll" DllEntry="DeleteDirectory" Execute="rollback" /> <Custom Action="Delete_D
<CustomAction Id="Delete_Directory_Rollback" BinaryKey="UnifiedAgentCustomActions.dll" DllEntry="DeleteDirectory" Execute="rollback" />
<Custom Action="Delete_Directory_Rollback" Before="RemoveFiles" >NOT (REMOVE="ALL")</Custom>
错误消息:
CustomAction Delete_Directory_Rollback返回实际错误代码1603,但由于继续标记,将转换为成功
预期结果
您正在该自定义操作中读取/写入会话属性。
如果是,则可能是您的问题,如日志中所示。您是否正在该自定义操作中读取/写入会话属性。
如果是,那么这可能是您的问题,如日志所示。它怎么不起作用?请你的问题给我们错误信息,预期结果,实际结果等。我已经编辑了我的文章的所有细节。它是如何不工作的?请你的问题给我们错误信息,预期结果,实际结果等,我已经编辑了我的文章与所有细节。
string InstallPath = session["INSTALLDIR"];
DeleteDir(InstallPath, session);
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Deployment.WindowsInstaller.InstallerException: Cannot access session details from a non-immediate custom action
at Microsoft.Deployment.WindowsInstaller.Session.ValidateSessionAccess()
at Microsoft.Deployment.WindowsInstaller.Session.get_Item(String property)
at UnifiedAgentCustomActions.CustomActions.DeleteDirectory(Session session)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
The same CA is working during uninstall but during roll back it is not working.