Msi insaller 从命令提示符传递参数以设置服务登录 [英] Msi insaller passing paramenter from command prompt for Set Service Login

查看:14
本文介绍了Msi insaller 从命令提示符传递参数以设置服务登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

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

这篇关于Msi insaller 从命令提示符传递参数以设置服务登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆