安装 MSI 之前删除文件和目录
多年来,我们的产品都是通过 InstallShield 安装程序安装的。我今年将安装更改为 MSI (WiX)。现在 MSI 应该清理该目录,该目录保持不变。
我在 MSI 中实施了一个自定义操作来开始卸载旧产品:
<CustomAction Id="UninstallIS" Property="QtExecCA" Value=""[WindowsFolder]IsUn0407.exe" -f "[ProgramFilesFolder]\company\product\Uninst.isu"" Execute="deferred" />
<CustomAction Id="QtExecCA" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />
删除旧产品后,存在临时文件和一些子目录,这些文件因客户端而异,并且 InstallShield 安装程序不知道,所以我会尝试通过 MSI 删除它们。
记住UAC,我认为我不能使用命令行命令来执行此操作,而且“删除文件表”在这里没有用(对于许多未知文件和许多目录)。
有什么可能的方法来做到这一点?
感谢您的帮助!
Our product was installed via InstallShield Setup over the years. I changed the installation to MSI (WiX) this year. Now the MSI should clean up the directory, which remains the same.
One custom action in the MSI I implemented to start the uninstallation of the old product:
<CustomAction Id="UninstallIS" Property="QtExecCA" Value=""[WindowsFolder]IsUn0407.exe" -f "[ProgramFilesFolder]\company\product\Uninst.isu"" Execute="deferred" />
<CustomAction Id="QtExecCA" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />
After the removal of the old product there are temporary files and some subdirectories that are different from client to client and are unknown to the InstallShield Setup, so I would try to delete them via the MSI.
Keeping the UAC in mind, I think that I can't use command-line commands to do this also the 'Remove File Table' is not useful here (to much unknown files and many directories).
What is a possible way to do this?
Thank You for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用将模拟标记设置为“否”的延迟自定义操作。这样它将在具有完全权限的本地系统帐户下运行。
自定义操作可以使用自定义代码(例如 EXE 或 DLL)或命令行。
请注意,延迟的自定义操作只能在 InstallExecuteSequence 中的 InstallInitialize 操作之后安排。
作为旁注,请确保对其进行彻底测试。从目标机器上删除文件是非常危险的。你永远不知道你最终会删除什么。
You can use a Deferred custom action which has Impersonate flag set to "no". This way it will run under the local system account with full privileges.
The custom action can use custom code (for example an EXE or DLL) or a command line.
Please note that deferred custom actions can be scheduled only after InstallInitialize action in InstallExecuteSequence.
As a side-note, make sure you thoroughly test it. Deleting files from the target machine is very dangerous. You never know what you may end up deleting.