/build/static/layout/Breadcrumb_cap_w.png

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.


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)

Posted by: jmaclaurin 13 years ago
Third Degree Blue Belt
0
The 2755 error appears to be the result of a corrupt MST (thanks again InstallShield). The VBScript is working as exptected.
Posted by: jmaclaurin 13 years ago
Third Degree Blue Belt
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?
Posted by: jmcfadyen 13 years ago
5th Degree Black Belt
0
your better off putting the registry key into a component and setting a condition on the component to a value of the appsearch.
Posted by: anonymous_9363 13 years ago
Red Belt
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]
Posted by: jmaclaurin 13 years ago
Third Degree Blue Belt
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.
Posted by: pjgeutjens 13 years ago
Red Belt
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
Posted by: jmaclaurin 13 years ago
Third Degree Blue Belt
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.
Posted by: pjgeutjens 13 years ago
Red Belt
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
Posted by: jmaclaurin 13 years ago
Third Degree Blue Belt
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?
Posted by: jmcfadyen 13 years ago
5th Degree Black Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ