2013-07-20 53 views
0

安裝MSI我有一個奇怪的問題,通過窗口服務

我有一個WPF application。我爲此創建了一個windows installer,安裝將在用戶的開始菜單中創建應用程序快捷方式。我正在通過windows service安裝此MSI。安裝工作正常通過Windows服務,但它並沒有創建快捷方式在開始菜單也我沒有看到這個程序和功能下的應用程序。但是,如果我手動安裝這一切工作正常。任何線索爲什麼會發生這種情況?

代碼來執行MSI

Process installProcess = new Process(); 
       //Assign required properties 
       installProcess.StartInfo.FileName = MSIEXEC; 
       installProcess.StartInfo.RedirectStandardError = true; 
       installProcess.StartInfo.UseShellExecute = false; 

       LogManager.Write("Process object is created"); 

       //Create new StringBuilder instance 
       StringBuilder stringBuilder = new StringBuilder(); 
       stringBuilder.Append(SYMBOL_SLASH); 
       stringBuilder.Append(SYMBOL_INSTALL); 
       stringBuilder.Append(installerPath); 
       stringBuilder.Append(SYMBOL_QN); 

       LogManager.Write("StringBuilder is created: " + stringBuilder.ToString()); 

       installProcess.StartInfo.Arguments = stringBuilder.ToString(); 
       installProcess.Start(); 
+0

只是一個問題......對於微星,你沒有保留任何屏幕?服務是否自動安裝一切? –

+0

我正在進行靜音安裝。所以我沒有看到任何屏幕。 – Kurubaran

+0

您可以在執行msi的服務中顯示代碼嗎? –

回答

1

InstallAllUsers在MSI設置爲false屬性。我的Windows服務在Local System account下運行,我的機器使用windows authenticationadministrator account下登錄。因此,當安裝發生時,假設用戶安裝了MSI,而不是使用Windows身份驗證登錄到計算機的用戶,因此它沒有顯示在開始菜單和程序和功能下。

我沒有必要保持InstallAllUsers爲false,所以我簡單地說它是真的,這解決了我的問題。