简体   繁体   English

如何从最终生成器设置inno设置脚本参数?

[英]How to set inno setup script parameters from final builder?

I am new to Final Builder 7 and got some work on it. 我是Final Builder 7的新手,并为此做了一些工作。

I want to set minor version from Final Builder 7 to inno setup script by asking user to enter the minor version number. 我想通过要求用户输入次要版本号来将Final Builder 7的次要版本设置为inno设置脚本。

I have defined user variable called minor, which is set by asking user input, I want to use this variable in one of the .iss files in the project. 我定义了一个名为minor的用户变量,该变量是通过询问用户输入来设置的,我想在项目中的一个.iss文件中使用此变量。

Any clue? 有什么线索吗?

Thanks in advance. 提前致谢。

-- With best regards Amol -致以诚挚的敬意Amol

I solved this using following script: 我使用以下脚本解决了这个问题:

#define AppVersion GetFileVersion("MyApp.exe")
#define Major
#define Minor
#define Rev
#define Build
#define Version ParseVersion("MyApp.exe", Major, Minor, Rev, Build)

[Setup]
AppName=MyApp
AppVerName={#AppVersion}
VersionInfoVersion={#AppVersion}
AppVersion={#AppVersion}
OutputBaseFilename=5{#Build}

-- Cheers -干杯

Looks like you are looking for user input. 看起来您在寻找用户输入。 We run many builds many times every day and user never needs to enter anything. 我们每天都会运行很多次构建,而用户则无需输入任何内容。 Final builder 7 has version control, or you can increment variable. Final Builder 7具有版本控制,或者您可以增加变量。 We use combination of that. 我们结合使用。 So, Final builder has the version, we don't touch it. 因此,最终构建器具有该版本,我们不对其使用。 For example, final builder has 1.1.2 and it also has incremental variable. 例如,最终生成器具有1.1.2 ,并且还具有增量变量。 In the end we get 1.1.2.345 where 345 is automatically incremented build number. 最后,我们得到1.1.2.345,其中345是自动递增的内部版本号。

Now, how we update Inno to the appropriate version. 现在,我们如何将Inno更新为适当的版本。 In our scripts we have #define(s) listed like this 在我们的脚本中,我们像这样列出了#define(s)

#define Major "@@major@@"
#define Minor "@@minor@@"
#define Anything "@@anything@@"

Where @@....@@ is a placeholder. 其中@@....@@是占位符。 Before running Inno script we execute Text Find / Replace action and our placeholders are replaced with real data. 在运行Inno脚本之前,我们执行文本查找/替换操作,并将占位符替换为实际数据。 Then we execute Inno using Run DOS Command / Batch File action and executing something like this 然后,我们使用“运行DOS命令/批处理文件”操作并执行类似的操作来执行Inno

iscc.exe "%BaseDir%\Install Files\MyLovelyInstallScript.iss"

This way, there is no need for user input, unless your software changes version completely. 这样,除非您的软件完全更改了版本,否则无需用户输入。 Then, we just change variables that represent numbers in 1.1.2 - a rare event. 然后,我们只更改代表1.1.2数字的变量-这是一种罕见的事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM