This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Environment Variables in IS2010 (InstallScript project))
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2009
04:03 PM
Environment Variables in IS2010 (InstallScript project))
Hi,
I need to add an environment variable permanently so that the installed application can use it.
1. I think the only way to do it before IS2010 was by writing to the registry.
is this right?
2. Is there a easier GUI way to just add env variables and its values in the new IS2010?
3. If there isn't, here is my current project.
I have used the IS view to copy application files (.NET) to the target.
IS2010 added a Setup.rul automatically.
It was blank until IS2010 automatically added the "OnFirstUIBefore()".
It added some labels inside this function like "Dlg_Start:", "Dlg_SdWelcome:", "Dlg_SdStartCopy2:" etc
a. Now where can I add the script to create registry values for the enviroment varibles?
This should be available to the entire system, all users and uninstallable.
Please give a small example or link.
Thanks
Vijay
I need to add an environment variable permanently so that the installed application can use it.
1. I think the only way to do it before IS2010 was by writing to the registry.
is this right?
2. Is there a easier GUI way to just add env variables and its values in the new IS2010?
3. If there isn't, here is my current project.
I have used the IS view to copy application files (.NET) to the target.
IS2010 added a Setup.rul automatically.
It was blank until IS2010 automatically added the "OnFirstUIBefore()".
It added some labels inside this function like "Dlg_Start:", "Dlg_SdWelcome:", "Dlg_SdStartCopy2:" etc
a. Now where can I add the script to create registry values for the enviroment varibles?
This should be available to the entire system, all users and uninstallable.
Please give a small example or link.
Thanks
Vijay
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2009
06:18 PM
If nothing else, perhaps search the InstallShield KB or www.installsite.org > InstallScript Samples > Operating System > Handle PATH Environment on NT.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 05, 2009
12:59 PM
Hi,
I was able to create the environment variables using InstallScript.
but now I have a new problem.
all my environment variables are new and get created in the registry.
except one, the "Path" environment variable.
This variable already exists and I used to append my path to the existing one.
but now, when I uninstall the "Path" env variable itself is getting removed from the registry !
so my question is:
1. How can I stop the path from getting removed during an uninstall?
2. If I can stop it then can I revert it back to the older path?
my scenario:
I am creating the env variables using installscript on the after last UI event.
Thanks
Vijay
I was able to create the environment variables using InstallScript.
but now I have a new problem.
all my environment variables are new and get created in the registry.
except one, the "Path" environment variable.
This variable already exists and I used to append my path to the existing one.
but now, when I uninstall the "Path" env variable itself is getting removed from the registry !
so my question is:
1. How can I stop the path from getting removed during an uninstall?
2. If I can stop it then can I revert it back to the older path?
my scenario:
I am creating the env variables using installscript on the after last UI event.
Thanks
Vijay
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 05, 2009
04:35 PM
What code are you using? The examples in the KB and on InstallSite should call Disable(LOGGING) to prevent the whole value from being removed...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 06, 2009
07:20 AM
You mean to say that if the variable "path" contains A;B as value and if you append your value C, then during the removal the complete A, B and C is getting removed? Is that right?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 06, 2009
09:42 AM
Yes, thats exactly whats happening.
Whats the best way to stop this?
Thanks
Update:
I am using an InstallScript project.
All the move data and other stuff are being done using the InstallShield 2010 UI (no script).
Only adding the environment variables is done using InstallScript.
Installshield had added an event handler OnFirstUIAfter()
here I call my own function 'SetupEnv'.
in the SetupEnv custom function I create the registry entries using (RegDBGetKeyValueEx, RegDBSetKeyValueEx etc)
Whats the best way to stop this?
Thanks
Update:
I am using an InstallScript project.
All the move data and other stuff are being done using the InstallShield 2010 UI (no script).
Only adding the environment variables is done using InstallScript.
Installshield had added an event handler OnFirstUIAfter()
here I call my own function 'SetupEnv'.
in the SetupEnv custom function I create the registry entries using (RegDBGetKeyValueEx, RegDBSetKeyValueEx etc)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 06, 2009
11:59 AM
As Robert mentioned, logging should be disabled with Disable(LOGGING); before calling any registry functions to change environment variables. If this is not done, the registry calls will log the registry value (not the data changed) that was changed and assume it needs to be removed during uninstall.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 06, 2009
12:20 PM
Hi ,
Thanks for the reply.
So I just need to put this line "Disable(LOGGING);" before I call the "SetupEnv" custom function that writes to the registry ?
What if I need only a few things to be kept in registry and a few other to be removed from registry on uninstall.
meaning, lets say the registry has two variables : A, B
I update A ,
don't touch B
and add a new one C
now on uninstall I need to revert back A or leave it as it is
leave B as it is
and remove C from the registry (since I added it during an install)
Lastly,
whatever I am doing, is it the right way to do things?
am I missing something?
am I doing something wrong?
can you point out a few things?
Thanks again.
Thanks for the reply.
So I just need to put this line "Disable(LOGGING);" before I call the "SetupEnv" custom function that writes to the registry ?
What if I need only a few things to be kept in registry and a few other to be removed from registry on uninstall.
meaning, lets say the registry has two variables : A, B
I update A ,
don't touch B
and add a new one C
now on uninstall I need to revert back A or leave it as it is
leave B as it is
and remove C from the registry (since I added it during an install)
Lastly,
whatever I am doing, is it the right way to do things?
am I missing something?
am I doing something wrong?
can you point out a few things?
Thanks again.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 06, 2009
02:02 PM
You can re-enable logging with Enable(LOGGING); if you would like to log any additional resources so that they are automatically removed during uninstall.
The approach you are using should work fine. As long as logging is enabled or disabled as needed, you should only need to test the installation to verify each scenario you expect works correctly.
The approach you are using should work fine. As long as logging is enabled or disabled as needed, you should only need to test the installation to verify each scenario you expect works correctly.