2012-10-23 102 views
1

我在VB.NET中有一個現有的應用程序,我需要安裝一個用於無人值守系統的免費EXE。我知道我必須安裝的路徑。在vb.net中以靜默模式安裝exe

注意:我只需編寫代碼在當前代碼庫中執行該代碼,並且無法爲其創建批處理文件。

直到現在我曾嘗試以下步驟: 我已經使用shell命令來執行EXE文件給喜歡額外的參數:

Shell("C:\MOVEit_Freely_Install.exe /q C:\yourlogfilename.log") 

Shell("C:\MOVEit_Freely_Install.exe /s") 

Shell("C:\MOVEit_Freely_Install.exe /silent") 

Shell("C:\MOVEit_Freely_Install.exe /qb C:\yourlogfilename.log") 

它只是打開,我必須單擊Next按鈕安裝程序,那麼它會得到安裝(我不想要)。

您能否就此提出建議。

感謝, 普尼特

回答

3

從正常cmd窗口執行該文件中像c:\moveit_freely_install.exe /?,它應該告訴你,如果有一個靜音選項。

交替地,如果它包裝一個.msi你可能會得到,並使用常規的微軟安裝程序開關,使其安靜。在這些情況下,我使用7zip來提取exe內容。如果您有7zip,請右鍵單擊該文件並選擇7zip - >提取。

如果你找到一個MSI,這裏是有趣的選項供您:

`/q n|b|r|f          Sets the UI level. 

               q , qn - No UI. 

               qb - Basic UI. 

               qr - Reduced UI. A modal 
               dialog box is displayed 
               at the end of the 
               installation. 

               qf - Full UI. A modal 
               dialog box is displayed 
               at the end of the 
               installation. 

               qn+ - No UI. However, a 
               modal dialog box is 
               displayed at the end of 
               the installation. 

               qb+ - Basic UI. A modal 
               dialog box is displayed 
               at the end of the 
               installation. If you 
               cancel the installation, 
               a modal dialog box is 
               not displayed. 

               qb- - Basic UI with no 
               modal dialog boxes. 
               The "/qb+-" switch 
               is not a supported UI 
               level.` 
+0

謝謝丹尼爾我正在嘗試將文件轉換爲MSI,然後我會研究您提供的解決方案。 –

0

像這樣的東西可能會有所幫助:

Dim myProcess As New Process 
Dim param as String = "/?" 
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden 
myProcess.StartInfo.CreateNoWindow = True 
myProcess.StartInfo.FileName = ("moveit_freely_install.exe" & param) 
myProcess.Start() 

它加載你的應用程序與它的參數,但沒有窗戶。