Am I correct in believing that if you put a Property as a substring within a Property, it should resolve to the full string? I cannot seem to get it to work.

I have 2 properties:
DomainDNSName = sample.local
ADMINCONSOLEDBLOCATION = \\[DomainDNSName]\dfs\MobilitiDB

and a registry key:
HKCU\Software\test\AdminConsoleDBLocation = [ADMINCONSOLEDBLOCATION]

I want [ADMINCONSOLEDBLOCATION] to resolve to \\sample.local\dfs\MobilitiDB at installation time. Instead of \\sample.local\dfs\MobilitiDB I am getting the literal string \\[DomainDNSName]\dfs\MobilitiDB in the registry value. As part of my troubleshooting, I have simplified it down to ADMINCONSOLEDBLOCATION = [DomainDNSName], but I still get the literal string [DomainDNSName]. I tried changing DomainDNSName to DOMAINDNSNAME, but I still get the literal string.

According to http://msdn2.microsoft.com/en-us/library/aa368609(VS.85).aspx (Formatted data type):
"If a substring of the form [propertyname] is encountered, it is replaced by the value of the property. If propertyname is not a valid property name, then the substring resolves as blank."
and on http://msdn2.microsoft.com/en-us/library/aa370745(VS.85).aspx (Path data type):
"The string may also contain a property name enclosed in square brackets [ ]. In such a case, the name of the property, including the brackets, is replaced in the string by the value of the property.
Examples:

  • UNC path: \\server\share
  • Local drive: c:\temp
  • With a property name: [DRIVE]\temp

..."

Although the above quotes are not specifically talking about properties within properties, everything else indicates that it should work.

I am using Wise Package Studio 5.6.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
I think I'm right in saying that if you only have the properties defined in the Property table, they will NOT be resolved in the way you require. However, there's a simple solution: just whack a Set Property Custom Action in your UI and EI sequences, using the required string '\\[DomainDNSName]\dfs\MobilitiDB' at the 'Property Value'.
Answered 01/11/2008 by: VBScab
Red Belt

Please log in to comment
0
@VBScab,
Thanks for your advice to use a Custom Action. I ended up doing it slightly differently to how you recommended, but your advice gave me the idea I needed to find the workable solution.
Answered 01/13/2008 by: Regen
Senior Yellow Belt

Please log in to comment
0
I ended up doing it slightly differently to how you recommended, but your advice gave me the idea I needed to find the workable solution.For the benefit of others, perhaps you could share what that solution was?
Answered 01/14/2008 by: VBScab
Red Belt

Please log in to comment
0
In my case, the property ADMINSONSOLEDBLOCATION is a public property that I wanted to be able to specify at the command line like
msiexec /i ism71.msi TRANSFORMS=ism71.mst ADMINCONSOLEDBLOCATION=\\server\share\etc

I did some testing, and found that if I set the property using a Set Property custom action in Execute Immediate, this overwrote the setting from the command line. To work around this, I wrapped it in an If statement. The If statement checks if the value of the Property has changed from the default, and only dynamically sets it if it has not changed from the default. If it has changed from the default, then it must have been set at the command line, so do not dynamically set it.

I probably could have done the If statement with native MSI Script commands, but I am more familiar with VBScript, to I chose to do the entire thing as an embedded VBScript custom action.

--- start script ---
'allow for public property ADMINCONSOLEDBLOCATION to be changed from command line at install time by using If statement
'to check If the value has changed from the default
If Session.Property("ADMINCONSOLEDBLOCATION") = "\\[DomainDNSName]\dfs\MobilitiDB" Then
Session.Property("ADMINCONSOLEDBLOCATION") = "\\" & Session.Property("DomainDNSName") & "\dfs\MobilitiDB"
End If
Answered 01/15/2008 by: Regen
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity