Sometimes we encounter such a situation where a software is divided into several versions. In fact, most of the content is the same, but there are slight differences between several files. Therefore, we hope to compile different versions in the same project by setting certain conditions.
Implementation Engineering: installscript 2009/2010
Implementation:
1. Define feature that meets different version requirements
For example, two feature versions can be created in China and abroad. One is named foroversea and the other is fordomestic. Then, slightly different files can be added to different feature versions. note: It is best to set the visible attribute of these two feature to "no", because these feature are only different for us and customers do not need to know
2. Which feature does the script install?
In function onfirstuibefore (), specify certain conditions and use the componentselectitem function to implement which feature to install under what conditions:
# Ifdef foroversea
Componentselectitem (media, "fordomestic", false );
# Else
Componentselectitem (media, "foroversea", false );
# Endif
3. Specify the version to compile
Find the settings option in the build menu, select the "compile/Link" tab, and enter the version to be compiled in Preprocessor. For example, if you need to compile a foreign version, enter foroversea (note: the foroversea entered here must be the same as that defined in script # def in step 1.
4. Select refresh build in the build menu to compile the desired version.
5. For is6.3, steps 2nd are slightly different,
1) You must first define global define # define fordomestic 0 // 0: fordomestic; 1: foroversea
2) # If (fordomestic = 0)
Componentselectitem (media, "foroversea", false );
# Elif (fordomestic = 1)
Componentselectitem (media, "fordomestic", false );
# Endif
Copyright statement: Indicate the original source for reprinting.