简体   繁体   English

安装前运行自定义操作 - Visual Studio 安装程序

[英]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.

相关问题 安装后使用“Microsoft Visual Studio 安装程序项目”安装 FTDI 驱动程序(自定义操作) - Using "Microsoft Visual Studio Installer Projects" to Install FTDI Driver after Installation (Custom Action) 在Visual Studio中创建自定义安装程序,以允许单独安装客户端和服务器 - Creating Custom installer in visual studio that allows separate installation for Client and Server 使用Visual Studio的自定义安装程序 - Custom installer with Visual Studio Visual Studio安装程序安装项目从自定义操作执行回滚 - Visual studio installer setup project perform rollback from custom action Visual Studio安装程序项目:“自定义操作”->找不到入口点 - Visual Studio Installer Project: Custom Action -> entry point not found 如何在 Visual Studio 2010 中为 c# 安装程序编写自定义操作? - how to write custom action for a c# installer in visual studio 2010? 在Visual Studio安装程序中更改安装路径(应用程序文件夹) - Changing the Installation Path (Application Folder) in Visual studio installer 如何将安装目录从安装程序传递到自定义操作? - How do I pass installation dir from the installer to a custom action? 通过保持先前版本安装的数据库完整来更新安装程序-Visual Studio安装程序 - updating Installer by keeping the DB of the previous version Installation intact - Visual Studio Installer 在安装程序项目中的安装之前添加安装MSI的自定义操作 - Add custom action of installing msi before the setup in installer project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM