在繼承了 Installer 的安裝程序類中,如何獲取安裝包的目錄,和程序要安裝到的目錄。 我試過 System.Windows.Forms.Application.StartupPath 和 System.AppDomain.CurrentDomain.BaseDirectory得到的都是在 system32 目錄。要安裝到的目錄 也不正確。
2 回答

阿晨1998
TA貢獻2037條經驗 獲得超6個贊
安裝程序要安裝到的路徑通過下面方法獲取
Custom Actions 下對應的Actions 的屬性中設置
CustomActionData 這個屬性為 /targ="[TARGETDIR]\"
Actions 的代碼中調用
string targ = Context.Parameters["targ"];
獲取目標路徑。
至于你安裝包所在目錄,可能是通過SourceDir 這個屬性來獲取的,你可試試看
- 2 回答
- 0 關注
- 529 瀏覽
添加回答
舉報
0/150
提交
取消