【问题标题】:Install exe in silent mode in vb.net在 vb.net 中以静默模式安装 exe
【发布时间】:2015-11-14 22:06:38
【问题描述】:

我在 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")

它只是打开安装程序,我必须在其中单击下一步按钮,然后它才会安装(我不想要)。

您能否就此提出任何建议。

谢谢, 普奈特

【问题讨论】:

    标签: vb.net installation silent


    【解决方案1】:

    从一个普通的 cmd 窗口执行c:\moveit_freely_install.exe /? 之类的文件,它会告诉你是否有静默选项。

    或者,如果它包装了一个 .msi,您可能会得到它并使用常规的 Microsoft 安装程序开关使其安静。在这些情况下,我使用 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.`
    

    【讨论】:

    • 感谢 Daniel,我正在尝试先将文件转换为 MSI,然后我会研究您提供的解决方案。
    【解决方案2】:

    这样的事情可能会有所帮助:

    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()
    

    它使用它的参数加载您的应用程序,但没有窗口。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-10
      • 1970-01-01
      • 2019-02-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多