cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Brian_Link
Level 3

Output Productcode to a file on install?

Hi folks - I'm new to Installshield (well, back after about 15 years) and of course have a hot issue:

I need to be able to output ProductCode to a text file along with my setup.exe. The current project I'm working on uses a Basic MSI Project. Is there some setting I can use, or could someone provide an example script to generate this file?

I would be most grateful. Thanks

BLink
Labels (1)
0 Kudos
(4) Replies
Evan_Border
Level 8

Brian Link wrote:
Hi folks - I'm new to Installshield (well, back after about 15 years) and of course have a hot issue:

I need to be able to output ProductCode to a text file along with my setup.exe. The current project I'm working on uses a Basic MSI Project. Is there some setting I can use, or could someone provide an example script to generate this file?

I would be most grateful. Thanks

BLink


You can easily accomplish this by using the Text File Changes view in the Installation Designer tab.

The steps are:

1. Add a dummy copy of your text file with text that you will replace using InstallShield's Text File Changes view.
In my example, I placed my text file in my app's main folder, [INSTALLDIR], and named it ProductCode.txt. The text file contains dummy text that the Text File Changes view will search for and replace:



2. Go to the Text File Changes view and add a new Change Set which tells InstallShield which file(s) to update.
In my example I pointed it to [INSTALLDIR] and specified my file name, ProductCode.txt (you can also use wildcards)



3. On the Text File Changes view, add a new Change which tells InstallShield about your new text.
In my example I told it to replace the text "ProductCode={00000000-0000-0000-0000-000000000000}" with "ProductCode=[ProductCode]"



That's it. After you run the install, go to [INSTALLDIR] and open ProductCode.txt and you'll see that it worked:

0 Kudos
Brian_Link
Level 3

Evan Border wrote:
You can easily accomplish this by using the Text File Changes view in the Installation Designer tab.


Thank you very much!
0 Kudos
Brian_Link
Level 3

Evan Border wrote:
You can easily accomplish this by using the Text File Changes view in the Installation Designer tab.


One question: I need to output this file to the Release path, ie: "SINGLE_EXE_IMAGE\DiskImage(s)\DISK1". I can't see a path variable for that - is there a way to build that into the release?

Thanks
0 Kudos
Evan_Border
Level 8

Brian Link wrote:
One question: I need to output this file to the Release path, ie: "SINGLE_EXE_IMAGE\DiskImage(s)\DISK1". I can't see a path variable for that - is there a way to build that into the release?

Thanks


The Text File Changes view works its magic at install time, not build time. If you want to copy something into your build folder as part of your build process, use the Releases view's Events tab. There you will see Postbuild Event, a feature of InstallShield Premiere Edition which allows you to call commands that run at the end of the build. It allows you to use InstallShield Path Variables, as well as Windows Environment Variables.





See the following help topic for more information:
h t t p : / / helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SpecifyingBuildEvents.htm
http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SpecifyingBuildEvents.htm

As for your question about the Release Path folder not having a Path Variable, it actually does and the above help topic talks about it. The name of the Path Variable is
0 Kudos