我正在做一個winform應用程序,需要卸載由installshield安裝的另一個Winform應用程序。我已經搜索了正確的方法來取消它是從已安裝的應用程序獲取GUID c#
Process.Start(「msiexec/x {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}」); 其中,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx表示要卸載的應用程序的GUID。
但我不我怎麼能找到從應用程序的GUID
稱爲text.exe
我發現
VAR總成= typeof運算(計劃).Assembly; var attribute =(GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute),true)[0]; var id = attribute.Value;
但這從當前的應用程序檢索GUID
。
任何想法?
您需要在註冊表中找到它。注意,我會手動執行此操作,並將您找到的GUID添加到您的程序中,而不是嘗試以編程方式從可執行文件名稱中找到它。與可執行文件名稱衝突的可能性太大。 –