当用户从浏览器下载 msi 时,如何将参数与 msi 一起传递? [英] How can i pass arguments along with an msi when a user downloads the msi from a browser?

查看:38
本文介绍了当用户从浏览器下载 msi 时,如何将参数与 msi 一起传递?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现的关于如何执行此操作的唯一建议表明我可以使用 msi 名称中的参数(即我想传递的值),然后在安装它的客户端上,我可以拉msi 中的名称并在那里使用它们.显然,以 msi 的名义公开值并不理想.我已经研究过使用 ClickOnce/Wix/标准安装程序来实现这一点,但我最终不得不将我的参数传递给 msiexec,在我看来,这意味着我在服务器上而不是客户端上,所以它会安装这个东西在服务器上,这不是我想要的.除非我在这里基本上遗漏了什么?

The only suggestions on how to do this i've found suggest that i can use the arguments (i.e. the values i want to pass) in the name of the msi, then on the client where it's been installed, i can pull the name out of the msi and use them there. Obviously it's not ideal exposing the values in the name of the msi. I've looked into using ClickOnce/Wix/standard installer to achieve this but i keep ending up with having to pass my arguments to msiexec, in my mind this means i'm on the server not the client so it'll install the thing on the server which isn't what i want. Unless i'm fundamentally missing something here?

推荐答案

REF: 如何下载带有用户 ID 参数的 MSI 安装程序

正如我在链接的答案中提到的,您可以对每个用户进行转换,并为用户提供一个包含 CMD/PS1/BAT 文件的 ZIP 文件,以通过转换启动 msi,例如:

As I mentioned in the linked answer you could make per user transforms and give users a ZIP file that contains a CMD/PS1/BAT file to launch the msi with the transform, eg:

msiexec -i c:\temp\The.msi transforms=c:\temp\YourPerso.mst

或者,您可以在服务器上烘焙"每个用户的 msi,然后为最终用户提供一个 url 以下载 msi.

Alternatively you could "bake" a per user msi on the server, then give the end user a url to download the msi.

如果我们使用 msiexec 那么它将安装在服务器上,因为它是服务器端代码.

if we use msiexec then that'll install on the server because it's server side code.

如果您登录到服务器并执行 msiexec 命令,那么它将安装在服务器上.您想要做的是创建每个用户的转换或烘焙每个用户的 msi,然后给最终用户一个下载链接.

If you are logged into the server and you execute the msiexec command then yes it will install on the server. What you want to do is either create per-user transforms or bake per user msi's and then give end users a link to download.

如果您有任何疑问或不清楚的地方,请告诉我.

Let me know if you have questions or if anything is unclear.

归根结底,我认为更好的策略是让用户连接到互联网一次,并以这种方式为他们提供唯一的用户 ID.然后将唯一 id 存储在注册表(或数据库、配置文件等)中,并在使用它进行任何外部调用之前始终检查 unqiue id 是否存在.

At the end of the day I think a better strategy is to make the user connect to the internet once and give them a unique user id that way. Then store the unique id in the registry (or database, config file, etc) and always check the unqiue id exists before making any external calls using it.

这篇关于当用户从浏览器下载 msi 时,如何将参数与 msi 一起传递?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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