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.


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

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
The 2755 error appears to be the result of a corrupt MST (thanks again InstallShield). The VBScript is working as exptected.
Answered 09/23/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
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?
Answered 09/23/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
your better off putting the registry key into a component and setting a condition on the component to a value of the appsearch.
Answered 09/23/2011 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
Question 1
I created the VBscript which works fine when run manually, but it looks like its not working when run in the CA.
How 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.Question 2
What is the best way to get an environmental variable into a property so that I can use it as a condition?
You can access environment variables directly, e.g. [%SystemRoot]
Answered 09/24/2011 by: VBScab
Red Belt

Please log in to comment
0
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.
Answered 09/26/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
Jeff,

since the FRA part in your condition is a literal, shouldn't it be

%WLANG="FRA" or %WLANG~="FRA"

I think if you put %WLANG=FRA Windows Installers goes looking for a property called FRA. Only for properties and numbers can you omit the quotes I believe.
just a thought...

PJ
Answered 09/26/2011 by: pjgeutjens
Red Belt

Please log in to comment
0
Yet another corrupted MST. Ugh, InstallShield is driving me nuts.

%WLANG="FRA" seems to have worked, but only as a condition on the Component and not on the Feature.

Thanks all for your help.
Answered 09/26/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
Jeff,

for the feature condition, what installlevel did you bring the feature to if the condition evaluates as true and did you make sure to put it lower than the MSI's INSTALLLEVEL property? Also what is the feature's initial installlevel set to?

PJ
Answered 09/27/2011 by: pjgeutjens
Red Belt

Please log in to comment
0
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?
Answered 09/27/2011 by: jmaclaurin
Third Degree Blue Belt

Please log in to comment
0
seems odd. you could always log the install and check the install level it will be resolved early on. I would make an assumption if it is not listed it would be 32768 I could be wrong however.
Answered 09/30/2011 by: jmcfadyen
Fifth Degree Black Belt

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