Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Can't subsitute variable into Strings


2 replies to this topic

saybo

saybo
  • Full Members
  • 11 posts

Posted 22 October 2007 - 21:23

Our company is preparing our software to be private-label branded by wholesalers for resale. The branding changes are very simple and from an installer perspective, I should be able to use the same .ism project and just change a hand full of things like ProductName and INSTALLDIR (ie. C:\Program Files\Our Company Name\ is substituted with C:\Program Files\Wholesaler's Company Name\).

We currently have a product named "Our Application" and I would like to go through the project and replace every use of the text "Our Application" with a variable I call BRANDNAME. Then I can use a script to change that variable at build time using ISCmdBld.exe -Z BRANDNAME="Wholesaler's Application".

I've done this and with the use of custom actions to set directory names, its working for me in folder names and registry entries.

What I can't get to work is, any text value that is stored in the Strings Table doesn't update. For example, I have a shortcut that has a display name, "{ID_STRING4}Our Application". So if I either edit the text there or go to the Strings table, find ID_STRING4 & change it from "Our Application" to "[BRANDNAME]" I end up with "[BRANDNAME]" on my shortcut after installing.

This happens with multiple Strings values, that's just one example. I see this concept works for other values in the Strings Table, ie IDS__IsExitDialog_Update_SetupFinished = "Setup has finished installing [ProductName]". Also, I have a few different projects, and when I compare the Property Manager, I see that sometimes a value is coming from the Strings Table, and sometimes not (Project 1 has ProductName set to "{ID_STRING16}Our Application" and Project 2 is just ProductName set as "Printer Driver".

So, here are my questions:
1) am I going about this the wrong way?
2) if not, what step am I missing?
3) why is text sometimes stored in Strings and sometimes not?

Thanks!
---mike

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 October 2007 - 14:13

It depends where the string is used in the project. In many places, such as static dialog text, Windows Installer replaces property names in square brackets with the value of the property, but not in all places.

Some properties are coming from the string table, others don't. Those that come from the string table are localizable. You can make any property localizable by right clicking it and selecting that option. For some properties it doesn't make sense to localize them, such as the ProductVersion, ProductCode, etc.

saybo

saybo
  • Full Members
  • 11 posts

Posted 29 November 2007 - 19:03

I thought I'd write a follow-up in case anyone is searching this topic. This is a frustrating inconsistency, that if you have a value in the string table with a variable, InstallShield will accurately show that variable in dialogs when it builds the dialogs, but it will not accurately update it in other areas at build time. You also can't simply update the string table value from command-line option like you can a property value.

My solution has been to stick with the property variable, letting it substitute where it can and running tests to find all the locations that did not update. We use a Perl script to call our InstallShield builds, so I use the script to search and replace the text I need to fix before each InstallShield build. So I do half the substitutions automatically during the build of the .ism project via the property value, and half somewhat manually through the perl script.