How to auto add product version on executable file name while executable file generated.
I'm using Installshield 2013 professional, script project. Everytime when executable file is generated, I should add version in file name manually then put it to a disk to backup. I want to know how to set file name that auto add product version on executable file name while executable file generated.
If you know the product version, you can try using automation layer objects to automate the product name
sample code to edit the single file name in installscript project:
NOTE: sample code is created for IS2021, you need to change the
pProject = CreateObject("ISWiAuto27.ISWiProject") to ISAIAuto20.ISWiProject
Dim pProject, ProjectPath
'Create project object for InstallShield 2021
Set pProject = CreateObject("ISWiAuto27.ISWiProject")
'for IS2013 automation layer support
'Set pProject = CreateObject("ISWiAuto20.ISWiProject")
'path to Project created
ProjectPath = "C:\test\Installscript\Installscript_test.ism"
'-1 = ISMSI Project Type, 9 = installscript pro, 1 = msi
pProject.CreateProject ProjectPath, 9
'change the -1 to 1 for BMSI project
pProject.OpenProject "C:\InstallShield 2021 Projects\Installscript_Test.ism"
' Set the Product Version
pProject.ProductVersion = "3.2.1"
'Selecting Existing Component
Set pTestComp = pProject.ISWiComponents.Item("DefaultComponent")
Set pFeature = pProject.AddFeature("New_Feature")
Set pComponent = pProject.AddComponent("New_Component")
Set pFile = pComponent.AddFile("C:\Windows\Notepad.exe")
'Set an existing product configuration
Set Release = pProject.ISWiProductConfigs.Item("Media").AddRelease("Test")
'Save the project:
'Build the release
Thank you for your quick reply. Your reply has opened a new door for me to implement automatic compilation in the future. But now I have some questions need your help.
Where is the sample code added in? Is the setup.rul of the current IS project?
If so, in which event is it added？OnSetTargetDir()?
If not, on which software perform this sample code?
Currently, I perform the following steps manually
1. open exists IS script project;
2. modify the product version;
3. bulild release;
4. open release folder and rename exe files's name.