Msi insaller passing paramenter from command prompt for Set Service Login

放肆的年华 提交于 2019-12-01 11:12:04

问题


Installer builder tool: Microsoft Visual Studio 2010 , Project Installer

I am trying to pass username and password for the installer to use for running Windows services that will install by the installer. By default installer ask the Credentials during installation that i want to pass through command prompt. see attached pic

I tried the solution that provided in the following issue. But still getting the "Set Service login" dialog during installation.

msiexec /i setup.msi USERNAME=yourUserName PASSWORD=yourPassword

How to Pass Command Line Arguments to MSI Installer


回答1:


Need to redesign Instalation using This http://www.codeproject.com/Articles/16767/How-to-Pass-Command-Line-Arguments-to-MSI-Installe aticle

I use additional for installer class logic:

public override void Install(IDictionary stateSaver)
    {
        if (!String.IsNullOrWhiteSpace(this.Context.Parameters["password"]))
        {
            this.QualsMetricsSchedulerServiceInstaller.Password = this.Context.Parameters["password"];
            this.QualsMetricsSchedulerServiceInstaller.Username = this.Context.Parameters["user"];
        }
        else
        {
            this.Context.Parameters.Remove("user");
            this.Context.Parameters.Remove("password");
            this.QualsMetricsSchedulerServiceInstaller.Password = null;
            this.QualsMetricsSchedulerServiceInstaller.Username = null;
        }
        base.Install(stateSaver);
    }

And CustomActionData: /USERNAME="[USERNAME]" /PASSWORD="[PASSWORD]" Now can install manualy and for silent instal use msiexec /i QualsScheduler.msi /qb username=.\Gavrishdv password=***



来源:https://stackoverflow.com/questions/6859660/msi-insaller-passing-paramenter-from-command-prompt-for-set-service-login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!