开发者

How can I give parameters to a WIX setup from the setup's download link

开发者 https://www.devze.com 2023-04-06 10:25 出处:网络
I\'m trying to do the following : Suppose a user with username \"annie\" is connected to the foo.example.com website

I'm trying to do the following :

  • Suppose a user with username "annie" is connected to the foo.example.com website
  • On the website I give a link to download a msi setup (developped with WIX 3.5)
  • The setup installs a small program that will ask logon information upon first launch (server name : foo.example.com, username : annie, password).

Since annie is already connected to the foo.example.com, it would b开发者_高级运维e great if the server name and user name were alreay pre-filled.

I know that for some remote-control software (NetViewer for example), you can send a mail invite to the person whose computer you want to control. In the mail you have a link containing the session number (for example : https://get.netviewer.com/support/join.php?sinr=502436783&sipw=nv64) wich prompts a download for the client software that upon launch will automatically have the session number automatically filled.

I don't know how they do it, but I suppose you can easily append a few bytes (session number) at the end of the exe file, and then have the executable look for the extra trailing bytes, the difference here is that it's not an exe that I control completely but an MSI file developped with WIX.

Do you have any pointers on how to do that ?


A solution is a script which uses the Windows Installer database API to modify some custom properties in your MSI Property table. These properties can then be used by controls on a custom installation dialog.

After modifying the MSI your script can serve it as a download link to the user.

If your package uses a digital signature, your script will also need to resign the package after modification.

There is no built-in support for this, so you will need to configure the package and write the script yourself.


This is another way to do it, if you do not want your private key to lie on a download webserver :

  • The link to download the msi file is dynamic (and aspx page for example)
  • This page creates a line in a central database that links "servername" + "username" to a unique identifier, say "connectid"
  • the page then Transmit the msi file but changes the name to something like "ourprocuct_connectid.msi"
  • The wix setup then stores the OriginalDatabase property in a registry value
  • Upon first launch the program check that registry value, if it exists, extracts the connectid, connects to a uniquer server that accesses the central database, and returns username and servername from the connectid

Phew !

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号