简体   繁体   English

System.Configuration.Install.Installer实例如何获取目标文件夹?

[英]How a System.Configuration.Install.Installer instance can get the destination folder?

When my ProjectInstaller : System.Configuration.Install.Installer is called by the Setup project the current path is c:\\windows\\system32 . 当安装项目调用我的ProjectInstaller : System.Configuration.Install.Installer ,当前路径为c:\\windows\\system32 How can I get the path where the application is being installed without hard coding this to the project ? 如何在不对项目进行硬编码的情况下获得安装应用程序的路径? (the destination path is something like c:\\program files\\[manufacturer]\\[service name] ) (目标路径类似于c:\\program files\\[manufacturer]\\[service name]

This question is perfectly answered by the method described in the link below: 通过以下链接中描述的方法可以完美地回答此问题:

How to make a System.Configuration.Install.Installer to get a variable from the Setup project? 如何使System.Configuration.Install.Installer从安装项目中获取变量?

string path = System.Reflection.Assembly.GetExecutingAssembly().Location

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

相关问题 如何在计划任务中使用System.Configuration.Install.Installer? - How to use System.Configuration.Install.Installer with scheduled tasks? 如何使System.Configuration.Install.Installer从安装项目中获取变量? - How to make a System.Configuration.Install.Installer to get a variable from the Setup project? 有没有办法获取基于任意xml的System.Configuration.Configuration实例? - Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml? 如何获得系统文件夹? - How to get the system folder? 通过installutil安装长期运行的服务时如何将参数传递给Configuration.Install.Installer - How to pass arguments to `Configuration.Install.Installer` when installing a long-running service through `installutil` 如何使用.NET 2 System.Configuration.Install检测更新? - How to detect an update using .NET 2 System.Configuration.Install? 如何为具有多个目标文件路径的EXE文件创建安装程序 - How to Create Installer For EXE Files With Multiple Destination Path for files 如何从源获取.pdf文件以将其复制到目标中的每日文件夹下? - How can I grab the .pdf files from source to copy it under daily folder in destination? 如何在不扩展安装程序的情况下安装Windows服务? - How to install Windows service without extending Installer? 如何覆盖dotnet发布的目标文件夹 - How to overwrite destination folder of dotnet publish
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM