Custom Action/System Search Help
AdminStudio 10 / InstallShield 2011
I am making a VBS Custom Action that will insert a registry key if an environmental variable is set to a something specific. As part of our OS build process, we set an environmental variable for the OS language (WLANG). This will be done in an MST to set the gui language of the app once its installed. I will likely use an Active Setup to perform a repair to set this for the users.
When I run the msi/mst, I get error 2755 immediately after I click Install.
Question 1
I created the VBscript which works fine when run manually, but it looks like its not working when run in the CA.
Question 2
What is the best way to get an environmental variable into a property so that I can use it as a condition?
I tried a System Search for a reg entry and I don't think its working.
Question 3
Is there a better way to do this?
I am making a VBS Custom Action that will insert a registry key if an environmental variable is set to a something specific. As part of our OS build process, we set an environmental variable for the OS language (WLANG). This will be done in an MST to set the gui language of the app once its installed. I will likely use an Active Setup to perform a repair to set this for the users.
When I run the msi/mst, I get error 2755 immediately after I click Install.
Question 1
I created the VBscript which works fine when run manually, but it looks like its not working when run in the CA.
const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Database Convert\esfdbcv\Setting\Language"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strValueName = "LangID"
dwValue = 12
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Question 2
What is the best way to get an environmental variable into a property so that I can use it as a condition?
I tried a System Search for a reg entry and I don't think its working.
Question 3
Is there a better way to do this?
0 Comments
[ + ] Show comments
Answers (10)
Please log in to answer
Posted by:
jmaclaurin
13 years ago
Posted by:
jmaclaurin
13 years ago
To check that the system search is working, I added this to the custom action and it displays the value of the property correctly.
CRAREG=Session.Property("CRAOSLANG")
Msgbox CRAREG
This displays the WLANG Enviromental variable (ENG or FRA) properly.
I set the condition to be CRAOSLANG=FRA but it doesn't seem to be working. How am I setting the condition incorrectly?
CRAREG=Session.Property("CRAOSLANG")
Msgbox CRAREG
This displays the WLANG Enviromental variable (ENG or FRA) properly.
I set the condition to be CRAOSLANG=FRA but it doesn't seem to be working. How am I setting the condition incorrectly?
Posted by:
jmcfadyen
13 years ago
Posted by:
anonymous_9363
13 years ago
Question 1How have you constructed the CA to be run? As it creates an HKCU entry, it needs to run in user context. The best way to do that is either with a new user-level feature created as a parent to an existing feature which contains an advertised entry-point (such as a shortcut) or via Active Setup.
I created the VBscript which works fine when run manually, but it looks like its not working when run in the CA.
Question 2You can access environment variables directly, e.g. [%SystemRoot]
What is the best way to get an environmental variable into a property so that I can use it as a condition?
Posted by:
jmaclaurin
13 years ago
Thanks for the tips. Component works if I don't put a condition on it.
Will a component work with a repair? I am intending to to use a repair with an active setup to populate the HKCU reg enty.
I have the condition working if I set it to soemthing like property=1 for positive and 0 for negative. When I specify %WLANG=FRA for positive, it doesn't seem to work either way, it always puts in the reg entry. I've tried putting the condition on the feature and the component and it makes no difference.
Will a component work with a repair? I am intending to to use a repair with an active setup to populate the HKCU reg enty.
I have the condition working if I set it to soemthing like property=1 for positive and 0 for negative. When I specify %WLANG=FRA for positive, it doesn't seem to work either way, it always puts in the reg entry. I've tried putting the condition on the feature and the component and it makes no difference.
Posted by:
pjgeutjens
13 years ago
Posted by:
jmaclaurin
13 years ago
Posted by:
pjgeutjens
13 years ago
Posted by:
jmaclaurin
13 years ago
Oddly enough, this MSI doesn't have INSTALLLEVEL listed in its Property table. I believe the default is 100 (correct me if I am wrong) so I tried 101, 200, etc and it made no difference.
All of the Features that the MSI has are set to INSTALL LEVEL = 1.
Any way that I can check the INSTALLLEVEL if its not listed?
All of the Features that the MSI has are set to INSTALL LEVEL = 1.
Any way that I can check the INSTALLLEVEL if its not listed?
Posted by:
jmcfadyen
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.