Msi insaller passing paramenter from command prompt for Set Service Login

前端 未结 1 712
旧巷少年郎
旧巷少年郎 2021-01-16 11:29

Installer builder tool: Microsoft Visual Studio 2010 , Project Installer

I am trying to pass username and password for the installer to use for runn

相关标签:
1条回答
  • 2021-01-16 11:41

    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=***

    0 讨论(0)
提交回复
热议问题