reset a variable which is dependent on the other bundle

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
balareddy
Posts: 6
Joined: 28 Feb 2012 23:31

reset a variable which is dependent on the other bundle

#1 Post by balareddy » 28 Feb 2012 23:35

How to Reset a variable in an installer to avoid dependency on a bundle in
a bat file.....

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: reset a variable which is dependent on the other bundle

#2 Post by foxidrive » 29 Feb 2012 02:37

Examples please.

balareddy
Posts: 6
Joined: 28 Feb 2012 23:31

Re: reset a variable which is dependent on the other bundle

#3 Post by balareddy » 29 Feb 2012 23:19

i have a batch script which uses a variable called EAT_HOME_DIR. I should Reset EAT_HOME_DIR variable in MH installer to avoid dependency on the EAT bundle in a postinstall.bat file.
The part of the script goes like this.......
set EAT_HOME_DIR=


mkdir "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc"



echo Y | cacls "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc" /E /G Everyone:R



echo Y | cacls "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc" /E /G Everyone:W

balareddy
Posts: 6
Joined: 28 Feb 2012 23:31

Re: reset a variable which is dependent on the other bundle

#4 Post by balareddy » 29 Feb 2012 23:22

Issue is that Currently this variable is getting reset in postinstall.bat so whenever AT version gets changed , it need to update postinstall.bat

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: reset a variable which is dependent on the other bundle

#5 Post by foxidrive » 01 Mar 2012 05:28

balareddy wrote:i have a batch script which uses a variable called EAT_HOME_DIR. I should Reset EAT_HOME_DIR variable in MH installer to avoid dependency on the EAT bundle in a postinstall.bat file.
The part of the script goes like this.......

set EAT_HOME_DIR=
mkdir "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc"
echo Y | cacls "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc" /E /G Everyone:R
echo Y | cacls "%ALLUSERSPROFILE%\Application Data\VERITAS\Security\Authentication\VRTSat_lhc" /E /G Everyone:W


EAT_HOME_DIR is being nulled above, and isn't used in those commands.

But you can use this in the post install bat after it is initialised, to clear it again.

set EAT_HOME_DIR=

balareddy
Posts: 6
Joined: 28 Feb 2012 23:31

Re: reset a variable which is dependent on the other bundle

#6 Post by balareddy » 28 Mar 2012 01:44

The case is i am asked to reset the EAT_HOME_DIR variable which is dependent on a bundle...

Currently this variable is getting reset in postinstall.bat so whenever AT
version gets changed , it need to update postinstall.bat...

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: reset a variable which is dependent on the other bundle

#7 Post by alan_b » 29 Mar 2012 05:30

Your variable IS BEING RESET by
set EAT_HOME_DIR=

I guess your question is wrong, perhaps you need to know how to CANCEL that reset.

SUGGESTION :-

Code: Select all

SET EAT_HOME_DIR_INITIAL=%EAT_HOME_DIR%
CALL postinstall.bat
SET EAT_HOME_DIR=%EAT_HOME_DIR_INITIAL%

balareddy
Posts: 6
Joined: 28 Feb 2012 23:31

Re: reset a variable which is dependent on the other bundle

#8 Post by balareddy » 29 Mar 2012 22:56

Got a clear idea now...
EAT_HOME_DIR is a environment variable...
This variable needs to be reset as it is affecting when ever the AT version gets changed....
Can you please give me an example script to reset the environment variable through the wix script...
The environment variable should reset at the installer level not at system level....

Thanks in advance.

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: reset a variable which is dependent on the other bundle

#9 Post by alan_b » 30 Mar 2012 02:16

I have shown you how to make a backup copy of whatever value %EAT_HOME_DIR% may possess,
and how to restore to %EAT_HOME_DIR% its previous value.
This is easy to do in a BAT script.

I do not know what you mean by
WIZ script
AT Version
Installer Level
System Level

I Googled the term "VERITAS\Security\Authentication\VRTSat_lhc"
You seem to be messing about with Symantic's VERITAS Certificates.

This seems to be relevant
http://sfdoccentral.symantec.com/vom/4. ... s01s08.htm

This seems to be erroneous
You can get the AT Profile directory from the following locations:

For 64-bit Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VERITAS\Security\Authentication\Credential Manager\Profiles\SYSTEM\ ProfileDir

For 32-bit Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Veritas\Security\Authentication\Credential Manager\Profiles\SYSTEM\ProfileDir

They may understand 32 bit Windows,
but 64 bit Windows will not accept the space in the path before " ProfileDir"

Are you sure that what you are doing is safe ?

Alan

Post Reply