2012-10-23 35 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() 

它加载你的应用程序与它的参数,但没有窗户。