[英]Running Custom Action before installation - Visual studio installer
I am working on a project where I need to run an action before installing a new version, this action is to check if there a product already installed and to uninstall it.我正在做一个项目,我需要在安装新版本之前运行一个操作,这个操作是检查是否已经安装了一个产品并卸载它。 I tried to add custom action in visual studio installer but I can't add a DLL file from the outside of the project so the action won't run before the installation.我尝试在 Visual Studio 安装程序中添加自定义操作,但我无法从项目外部添加 DLL 文件,因此该操作在安装之前不会运行。 My application is a Microsoft office addin so that why I used visual installer because it is very simply and straightforward.我的应用程序是 Microsoft Office 插件,所以我使用可视化安装程序是因为它非常简单明了。 Is there any another solution?还有其他解决方案吗?
Note : Changing product code and set DetectNewerVersion to true didn't work,
now I have two same product in Program and Features
Here you can find InstallExecuteSequence numbers .在这里您可以找到InstallExecuteSequence 编号。 You just should put yours custom action in right place, for example you can set Sequence=750 - it will be run before CostInitialize.您只需将自定义操作放在正确的位置,例如您可以设置 Sequence=750 - 它会在 CostInitialize 之前运行。
Also here's video tutorial how to use orca.exe.这里还有如何使用 orca.exe 的视频教程。 It's amazing app to check and debug your msi.这是检查和调试您的 msi 的了不起的应用程序。 In your case you can check is your CustomAction in right place or you should change number, or even your custom action isn't working.在您的情况下,您可以检查您的 CustomAction 是否在正确的位置,或者您应该更改数字,甚至您的自定义操作不起作用。
And about "I tried to add custom action in visual studio installer but I can't add a DLL file from the outside of the project so the action won't run before the installation".关于“我尝试在 Visual Studio 安装程序中添加自定义操作,但我无法从项目外部添加 DLL 文件,因此该操作不会在安装之前运行”。 I can't get what do you mean, but seems that you can't add dll with custom actions.我不明白你的意思,但似乎你不能用自定义操作添加 dll 。 Here's tutorial about it . 这是关于它的教程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.