获取安装路径 [英] Getting Installation Path

查看:56
本文介绍了获取安装路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在安装过程中获取使用C#中的Windows安装程序构建的安装程序(即.msi或.exe)文件的路径?我设计了一个安装文件,必须在安装过程中将文件从安装目录复制到目标目录。我知道如何检索目标目录,但缺​​乏检索.msi或执行安装的.exe文件的位置的想法。请大家帮忙。

解决方案

参见如何获取msi-path-in-installerclass-in-c-sharp [ ^ ]

你不能简单地使用%~p0 (路径)或%~dp0 (驱动器+路径),这些工作在命令行/批处理文件上。



祝你好运!


Is there a way to get the path of the a setup (i.e. the .msi or the .exe) file built with the windows installer in C# during installation? I have designed a setup file that must copy a file during the installation from the setup directory to the target directory. I know how to retrieve the target directory but lack ideas to retrieve the location of the .msi or the .exe file that did the installation. Please folks I need help.

解决方案

See how-to-get-the-msi-path-within-installerclass-in-c-sharp[^]


Couldn''t you simply use %~p0 (path) or %~dp0 (drive+path), these work on the commandline/batch file.

Good luck!


这篇关于获取安装路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆