View Full Version : ProductName and "Advanced Settings | File Types"
01-13-2006, 05:52 PM
I'm setting up file types for my application. Is it possible to use the system ProductName in the text that the user sees? For instance, I'd like to use
"&Open with [ProductName]" rather than "&Open with MyProduct"
I tried the above to no avail. I wound up seeing [ProductName]. :-( It appears that the use of [ProductName] in InstallShield is quite limited or am I doing something wrong?
Can a string table entry infer another string table entry as a possible solution, like
IDS_SUBSTRING Hello World!
IDS_MYSTRING A day is not complete until @IDS_SUBSTRING is uttered.
or something like that?
01-14-2006, 09:59 AM
(Follow-up of sorts here.)
03-20-2006, 02:06 AM
In MSI projects, the Product Name is a property stored in the Properties table. In order to change it in run time, create a custom action, make sure to locate it in the sequence before the dialog box and in it call the above API to change the value if this property.
Hope this will do
03-20-2006, 09:30 AM
It's nice that you showed me a new API :) but that wasn't really what I was asking for. I have a number of situations where I would like to use one string table entry embedded inside the other. I can always use some sort of 'sprintf' call, but the final string is not always inside the InstallScript code.
Thanks anyways for the attempt,
06-27-2006, 06:56 AM
Can anybody answer the original question? Which is can you embed one string within another?
I don't need to do anything complicated, I don't mind but don't need to link to a property I don't need to change this at run time - I know the substring I want to use at build time.
I have been asked to 'OEM' our products, basically change them to look like they are from another company and called a different name, I've got to do this for 5+ companies but nothing dynamic, I need to produce 5+ different static packages. There are 4 or 5 different words or phrases I want to use repeatedly for each OEM, why can't I just declare 4 or 5 different substrings (or properties), edit them prior to each build, and then have IS expand them out in dozens of other strings in each OEM package I build. I'm sure this is a common requirement.
I have tried using properties and got intermittent success, it worked on the Welcome Dialog and SetupCompleteSuccess Dialog for example but not on other dialogs inbetween.
11.5 InstallScript Project
06-27-2006, 11:17 AM
I'd like an answer to the original question too. My only thought is to create a proxy function, say, MyLoadString. This function would look for embedded '@IDSTR_XXXXX' tags and then expand them. The InstallScript code would then use this function rather than directly calling @IDSTR_XXXXX. Think of C++/VB6, where you have to use a LoadString() method. Hmm, I'm surprised that I didn't think of a solution like this one at the time. Here, let me get us started.
I wrote this out from my head and didn't do any debugging. I'll let you do that, although it should work, as visually I don't see any errors.
1. An embedded token should end with an '@', i.e.
IDSTR_MYTEST "Hello World and @IDSTR_SZIAVILAG@ are the start of something beautiful."
2. I didn't add an internal Printf/Sprintf() call, although that could be another improvement.
3. BTW, I don't believe in the statement that something can't be done. All that means is that no one thought of a solution yet. That's all.
4. I apologize for the visual of the function. It seems that my tab characters went bye-bye on the display. :-( Hopefully then will be retained if you copy and paste to a function.
5. If you or anyone else uses this function, I'd appreciate it if you leave the Author section intact, so that if others have any questions that they can contact me and so that I can get credit.
What do you think? Does this answer our question? Contact me if you have any questions. My contact information is on my website.
prototype STRING MyLoadString(STRING);
// FUNCTION: MyLoadString
// EVENT: This function loads a string from the registry and expands any embedded strings.
// SUB STRINGS: Enclose sub string IDs in @ symbols, i.e. @IDSTR_TOINSERT@
// Marci Weinberger: ButterflyVista.com / JobFish.com
NUMBER iLen, iPosStart, iPosNext, iPosEnd;
STRING szWorking, szID, szReturn, szSub, szTokSep;
// Strip off the leading '@' symbol if present.
iPosStart = StrFind(szIDToLoad, "@");
if (0 <= iPosStart)
StrSub(szIDToLoad, szIDToLoad, (iPosStart + 1), (StrLength(szIDToLoad) - iPosStart));
// Load the working string.
// Get the string length.
iLen = StrLength( szWorking );
// Set the token separator.
szTokSep = "@";
// Cycle through the string.
iPosStart = 0;
szReturn = "";
// Get the position of the next sub-token.
iPosNext = StrFindEx(szWorking, szTokSep, iPosStart);
if (0 <= iPosNext)
// Extract the string up until this point.
StrSub(szSub, szWorking, iPosStart, (iPosNext - iPosStart) );
szReturn += szSub;
// Find the end of the token.
iPosEnd = StrFindEx(szWorking, szTokSep, iPosNext);
if (0 > 0)
iPosEnd = iLen;
// Extract the token and nuke the token separator.
StrSub(szID, szWorking, iPosStart), (iPosEnd - iPosStart - 1));
// Load the token from the string table.
szReturn += szSub;
// Get ready for the next token.
iPosStart = iPosEnd + 1;
// Return the entire rest of the entry string.
szSub = StrSub(szSub, szWorking, iPosStart, (iLen - iPosStart));
szReturn += szSub;
// Fail out and return the complete string.
iPosStart = iPosNext;
} while(0 <= iPosStart && iPosStart <= iLen);
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.