How can I dynamically create setup file based on unique identifier?

孤人 提交于 2019-12-10 23:45:07

问题


I have created an outlook Add-In and its working perfectly fine, but I would like to know how can I create a setup file for Add-in where Add-in has unique company details, so as there might be lots of company list, how can I compile setup file with Unique ID for every company, as it will be dynamic.

Is it possible to do? If yes how can I accomplish it? If not is there any alternative idea to accomplish it? Is it something possible with inno-setup? Is it possible to compile the exe file at runtime in php?


回答1:


Yes, you can build the setup passing values to the preprocessed script. There is the /d command line parameter of the command line preprocessor compiler. See e.g. this very simple script:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
AppPublisher={#Publisher}
AppPublisherURL={#PublisherWeb}

This script you can build with the ISCC.exe command line tool passing the values to the expected variables e.g. this way:

iscc "/dPublisher=My Company" "/dPublisherWeb=www.example.com" "c:\Script.iss"

That will preprocess the script passing the values and build the output setup binary. If you'd like also to save the preprocessed scripts somewhere, you can put a line like this to the very end of your script:

#expr SaveToFile("c:\PreprocessedScript.iss")

That will store the script with the values filled by preprocessor.



来源:https://stackoverflow.com/questions/20698147/how-can-i-dynamically-create-setup-file-based-on-unique-identifier

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