How can i pass arguments along with an msi when a user downloads the msi from a browser?

谁说我不能喝 提交于 2019-12-11 17:32:21

问题


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?


回答1:


REF: How to Download MSI installer with argument for user-id

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

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

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

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.


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.



来源:https://stackoverflow.com/questions/54802158/how-can-i-pass-arguments-along-with-an-msi-when-a-user-downloads-the-msi-from-a

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