Just a quick question about msi property.
Say I have a property defined in the property table by name IPADDRESS with default value as 1.1.1.1.
I install the app with the above property IPADDRESS=2.2.2.2. So obviously 1.1.1.1 will be replaced by 2.2.2.2.
Say this value is put under one registry key or INI file somewhere.
Now if I repair the msi through control panel (forcibly), what will be the value ? whether it is 2.2.2.2 (which I except to be there) or original 1.1.1.1 ?
I would have thought it takes 2.2.2.2 but in reality it doesn't. Because the temp msi under winnt\installer also has the default value 1.1.1.1 in the property table instead of 2.2.2.2.
Any idea how to handle this ?
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.
MSI Property
Started by
steevan16
, Aug 08 2005 14:12
2 replies to this topic
Posted 08 August 2005 - 16:14
you might consider having AppSearch look for the registry key or ini file entry where the address is stored, and then having a custom action set the IPADDRESS property if the entry is found.
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com
Posted 09 August 2005 - 15:40
Yes, that's right - you have to store/retrieve the values yourself.
Here's a VBScript I wrote to help solve this:
On Error Resume Next
Dim oWsh, sLastValue, sCurrentValue
'Modify the following two constants As required
Const sPROPERTYNAME = "MYAPP_IPADDRESS"
Const sDEFAULTVALUE = "1.1.1.1"
Const sPROPERTYREGLOC = "HKLM\Software\MyCompany\Public Properties\"
Set oWsh = CreateObject("WScript.Shell")
sLastValue = oWsh.Regread(sPROPERTYREGLOC & sPROPERTYNAME)
sCurrentValue = Me.Property(sPROPERTYNAME)
If sCurrentValue = "" Then
If sLastValue = "" Then
oWsh.RegWrite sPROPERTYREGLOC & sPROPERTYNAME, sDEFAULTVALUE, "REG_SZ"
Me.Property(sPROPERTYNAME) = sDEFAULTVALUE
Else
Me.Property(sPROPERTYNAME) = sLastValue
End If
Else
oWsh.RegWrite sPROPERTYREGLOC & sPROPERTYNAME, sCurrentValue, "REG_SZ"
End If
Set oWsh = Nothing
I simply embed this script just before "installinitialize" (non-deferred).
Here's a VBScript I wrote to help solve this:
On Error Resume Next
Dim oWsh, sLastValue, sCurrentValue
'Modify the following two constants As required
Const sPROPERTYNAME = "MYAPP_IPADDRESS"
Const sDEFAULTVALUE = "1.1.1.1"
Const sPROPERTYREGLOC = "HKLM\Software\MyCompany\Public Properties\"
Set oWsh = CreateObject("WScript.Shell")
sLastValue = oWsh.Regread(sPROPERTYREGLOC & sPROPERTYNAME)
sCurrentValue = Me.Property(sPROPERTYNAME)
If sCurrentValue = "" Then
If sLastValue = "" Then
oWsh.RegWrite sPROPERTYREGLOC & sPROPERTYNAME, sDEFAULTVALUE, "REG_SZ"
Me.Property(sPROPERTYNAME) = sDEFAULTVALUE
Else
Me.Property(sPROPERTYNAME) = sLastValue
End If
Else
oWsh.RegWrite sPROPERTYREGLOC & sPROPERTYNAME, sCurrentValue, "REG_SZ"
End If
Set oWsh = Nothing
I simply embed this script just before "installinitialize" (non-deferred).
Edited by mandy, 09 August 2005 - 15:41.