简体   繁体   English

Visual Studio安装项目

[英]Visual Studio Setup Project

I'm trying to use a Visual Studio Setup Project to deploy a C# Application. 我正在尝试使用Visual Studio安装项目来部署C#应用程序。

In a VS Setup project, is it possible to dynamically change the application folder before a project is installed, or even to add any code behind the set-up project at all? 在VS安装项目中,是否可以在安装项目之前动态更改应用程序文件夹,甚至根本不向安装项目后面添加任何代码?

What I am trying to achieve is an msi that runs, calculates the installation directory based on some external factors and then installs to that directory. 我要实现的目标是运行一个msi,根据一些外部因素计算安装目录,然后安装到该目录。 I then want it to run the application immidiately. 然后,我希望它立即运行该应用程序。 The objective for this is no user intervention throughout. 这样做的目的是始终没有用户干预。

Edit: Seeing your amended question I think that you'll still want to look at a custom action but that you want to look at this msdn page instead. 编辑:看到您的修订问题,我认为您仍然希望查看自定义操作,但希望查看 msdn页面。 It's about changing the target location in various ways. 这是关于以各种方式更改目标位置。

As 0xA3 says, the user can choose the target folder during the install. 正如0xA3所说,用户可以在安装过程中选择目标文件夹。

Re your own code, you probably want to look at Custom Actions. 重新编写自己的代码,您可能希望查看自定义操作。 You can write your own code in a DLL that can then be called from the Custom Actions. 您可以在DLL中编写自己的代码,然后可以从“自定义操作”中调用该DLL。

This walkthrough is a good sample. 演练是一个很好的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM