简体   繁体   English

我的程序已“发布”,如何更改安装路径?

[英]My program has been “published”, how can I change the installation path?

I "published" my C# solution in Visual Studio 2008 to C:\\Deploy. 我在Visual Studio 2008中将我的C#解决方案“发布”到C:\\ Deploy。 When I run the setup.exe program, it installs my program to C:\\Documents and Settings\\Kevin\\Start Menu\\Programs\\MyProgram 当我运行setup.exe程序时,它将我的程序安装到C:\\ Documents and Settings \\ Kevin \\ Start Menu \\ Programs \\ MyProgram

Is there any way, within Visual Studio, to set a custom install path? 在Visual Studio中,有没有办法设置自定义安装路径? For instance, what if I wanted my program to install to C:\\Program Files\\MyProgram? 例如,如果我希望我的程序安装到C:\\ Program Files \\ MyProgram怎么办?

Publishing uses ClickOnce for deployment. 发布使用ClickOnce进行部署。 ClickOnce has the advantage that it's easy to install and update, and doesn't require the user to have administrator privileges to install your application. ClickOnce的优点是易于安装和更新,并且不需要用户具有管理员权限来安装您的应用程序。

If you'd like a more traditional next-next-next-next-finish installer, which also allows the user to specify the target folder (and for you to set/force a default one), add a "Setup Project" to your solution by clicking File >> Add >> New Project..., in the tree select Other Project Types >> Setup and Deployment and double click Setup Project. 如果你想要一个更传统的下一个下一个下一个完成安装程序,它也允许用户指定目标文件夹(并且你可以设置/强制使用默认文件夹),添加一个“安装项目”到你的单击文件>>添加>>新建项目...,在树中选择其他项目类型>>设置和部署,然后双击设置项目。 When you build the setup project, it create an MSI file (Microsoft Installer setup file) and a bootstrapper EXE file (in case the user doesn't have Microsoft Installer or the required .NET Framework, which it then installs automatically). 在构建安装项目时,它会创建一个MSI文件(Microsoft Installer安装文件)和一个引导程序EXE文件(如果用户没有Microsoft Installer或所需的.NET Framework,则会自动安装)。

ClickOnce ("published") applications are installed per user in the user application cache location. 在用户应用程序缓存位置为每个用户安装ClickOnce(“已发布”)应用程序。 There is no way you can change this location ;-) 你无法改变这个位置;-)

You have to use your own setup packaging tool in order to choose or let the user choose the location. 您必须使用自己的安装包装工具才能选择或让用户选择位置。 Or you can just distribute your application as a zipped executable, if no installation routine has to be called, liked registering file types or adding keys to the registry. 或者,如果不需要调用安装例程,喜欢注册文件类型或向注册表添加密钥,则可以将应用程序分发为压缩的可执行文件。

暂无
暂无

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

相关问题 数据库更新后如何通知我的程序? - How can I notify my program when the database has been updated? Tridion:如何使用业务连接器查明页面是否已发布到特定发布目标? - Tridion : How can I find out if a page has been published to a particular publication target using the business connector? 我如何获得程序崩溃的通知 - How can I get notification that my program has crashed 如何知道exe的安装路径? - How can I know installation path of a exe? 如何使用C#检查使用最多的程序? - How can I check what program has been used the most using C#? 如何删除图像属性,例如Adobe Illustrator已嵌入到PDF文件的本地路径? - How can I remove image properties such as local path that Adobe Illustrator has been embedded to PDF file? 如何在运行时将多次在XAML ResourceDictionary中定义的Path添加到WPF表单? - How can I add a Path, that has been defined in the XAML ResourceDictionary, multiple times to a WPF form at runtime? 如何在没有错误的情况下加载我的场景 [场景尚未添加到构建设置或 AssetBundle 尚未加载] - how can I load my scenes without the error [scene has not been added to the build settings or the AssetBundle has not been loaded] 一旦该属性已传递给 C# 中的 function,我该如何更改该属性 - How can I change the property once that property has already been passed to a function in C# 在 FileSystemWatcher 中添加或删除新文件时,如何更改 ListView 中的文本颜色? - How can I change the text color in ListView when a new file has been added or deleted in FileSystemWatcher?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM