C#,Visual studio 2010Visual Studio 2010安裝項目[ProductName]
我有一個應用程序項目和連接到應用程序的安裝項目。 在Setup projects屬性中,我已將ProductName屬性設置爲MyApp。
我在應用程序文件夾兩個環節(安裝項目), 一個啓動項目,一個用於卸載
我使用創建的應用程序文件夾中的卸載程序鏈接的技術通過 開始我的應用程序用標誌和應用產品這樣的代碼 --uninstall [產品代碼]
我不能使用[產品名稱]作爲鏈接的名稱來啓動應用程序,這是爲什麼? 如果這樣,安裝項目將在開始菜單 下的應用程序文件夾中創建一個名稱爲[ProductName]而不是「MyApp」的鏈接。
如何本地化「刪除鏈接」,今天我將卸載程序鏈接命名爲「刪除MyApp」? 我希望那就是有可能做這樣的事情「strings.Remove [產品名稱]」
是否有可能安裝項目以這樣的方式我MyApp項目的 安裝項目獲取應用程序名稱連接,MyApp項目中的版本號等。 像
ProjectName = MyApp.properties.Application.AssemblyName
/斯特凡
我明白了,謝謝你的answear
你爲什麼不使用msiexec.exe的命令行此 設置屬性
我正在使用t他MSIEXEC,我調用它在我的應用程序App類這樣
sComLine = CommandLine.CL.get("uninstall"); // Check command line if the --uninstall [ProductCode] is given
if (sComLine != null)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
System.Diagnostics.ProcessStartInfo uninstallProcess = new System.Diagnostics.ProcessStartInfo(path + System.IO.Path.DirectorySeparatorChar + "msiexec.exe", "/x " + sComLine);
System.Diagnostics.Process.Start(uninstallProcess);
System.Windows.Application.Current.Shutdown();
}
我明白了,謝謝你的回覆 –