应用程序从MSI安装程序自动启动 [英] application auto launch from MSI installer

查看:191
本文介绍了应用程序从MSI安装程序自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个小型桌面应用程序,使用Windows身份验证连接sql server数据库。

i have small desktop application which connect sql server database using windows authentication.

我为这个项目创建了安装程序,这样用户就可以从网站下载并安装我的桌面应用程序,因为我创建了MSI文件。

i have created Installer for this project so user can download and install my desktop application from website, for that i have created MSI file.

我的要求是安装完成后我的应用程序在安装后自动启动,为此我在我的应用程序中添加了安装程序类并覆盖了提交的方法,然后在该方法中我调用了我的应用程序exe。

my requirement is once installation is completed my application get auto launch after installation and for that i have added installer class in my application and override commited method and then in that method i am calling my application exe.

以下代码段

  Private Sub MyInstaller_Committed(ByVal sender As Object,

     ByVal e As InstallEventArgs)

           试试¥b $ b                Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly()。Location)))
               

              

                Process.Start(Path.GetDirectoryName(Assembly.GetExecutingAssembly()。Location)+" \EDMSCont.exe")

 Private Sub MyInstaller_Committed(ByVal sender As Object,
        ByVal e As InstallEventArgs)
            Try
                Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
               
              
                Process.Start(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\EDMSCont.exe")

我的应用程序exe在安装完成后正确调用,应用程序在MSI安装结束后启动。

my application exe get called correctly after installation get completed and application get launched after end of MSI installation.

但问题是当exe开始并且它尝试连接作为SYSTEM用户帐户运行的SQL服务器而不是Windows帐户并且因为它没有使用Windows帐户SQL Windows身份验证失败,这个问题仅在自动启动应用程序$ b $时发生b在安装结束时通过MSI安装程序。

but problem is when exe get started and it try to connect SQL server it running as SYSTEM user account and not windows account and because its not using windows account SQL windows authentication is failing , this issue only occurs while auto launch of application through MSI installer at the end of installation.

如果用户手动点击应用程序exe,它会使用户身份验证但工作正常。

if user click on application exe manually its take users windows authentication but work properly.

问题我只是在安装结束时第一次启动应用程序自动启动。

the issue I am facing only first time of launching of application through end of installation auto launching.

当我在网上搜索时,我发现MSI安装程序总是在  NT AUTHORITY\SYSTEM及其使用的SYSTEM帐户。

when I search on net i found MSI installer always run under NT AUTHORITY\SYSTEM and its used SYSTEM account.

有什么方法可以使用Windows帐号用户谁insta通过MSI获取我的应用程序。

is there any way i can use windows account of user who installing my application through MSI.

此问题仅通过MSI首次启动应用程序

this issue occuring only first launch of application through MSI

如果有任何解决方案,请告诉我。

谢谢,

Chetan R

推荐答案

Hi Chetan,

Hi Chetan,


我发现这里有类似的问题和解决方案:

I found there is a similar issue and solution here:

如何通过Windows身份验证从msi安装程序连接mssql


这篇关于应用程序从MSI安装程序自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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