如何將C#安裝路徑寫入注冊表
作者:佚名
一般在安裝過程中C#安裝路徑是默認(rèn)的,如果要更改,也取決于不同的系統(tǒng)。本文將詳細(xì)介紹如何將C#安裝路徑寫入注冊表,希望對大家有所幫助。
如何將C#安裝路徑寫入注冊表的提問
安裝程序如將項目的安裝路徑寫入注冊表 如:
- key =myform
- value =E:\test\SystemTray\SystemTray.EXE
如何將C#安裝路徑寫入注冊表的回答1
Value = [TARGETDIR]\后面是你的相對路徑
如何將C#安裝路徑寫入注冊表的回答2
獲取安裝路徑
如何將C#安裝路徑寫入注冊表的回答3
- string str = Assembly.GetExecutingAssembly().GetName().CodeBase;
- if (str.ToLower().IndexOf("file:///") >= 0)
- {
- str = str.Substring(8, str.Length - 8);
- }
- string path = System.IO.Path.GetDirectoryName(str);//這個就是安裝路徑
在自定義操作中添加屬性數(shù)據(jù).
- /dir=[TARGETVDIR] /targetdir="[TARGETDIR]\
【編輯推薦】
責(zé)任編輯:彭凡
來源:
CSDN