|
Answer» I change a lot of programs over to stand alone programs. Which means I Change the c path in the program to systemdrive and excetra but sometimes it does not work. If the program needs to pull up a cmd prompt I get an error. Is there a way I can set it up to STOP this. I would like to stop this behavier and change all paths in my registry to variables..I'm not sure i'm clear on what your goals are here... Won't changing app locations break the association in the registry ? ?patio is being very polite. Personally, I have absolutely no idea what you are talking about.%systemDrive% reflects the current system drive.
%programfiles% is not always on %systemdrive%. if that's the case then any use of %systemdrive% would go to the wrong drive.
And, if the program purposely installs to %systemdrive% and saves it as an absolute path, such as C:\ in the registry during installation, you MUST consider that your systemdrive can only change when you reinstall windows.
At which point you would need to reinstall the program. At which point the value is written with the new system drive.
I'm not even clear on what the entire aim is here. Changing all the "absolute paths" in the registry that will only change after a system reinstall is a tad silly. Additionally, remember that the programs reading the strings might not even expand environment variables; this is especially true for "REG_SZ" VALUES as opposed to "REG_EXPAND_SZ" values. at which point the program will literally try to VIEW a path called "%SystemDrive%" and fail miserably.Personally...i'd just install things to where you want them.Quote from: patio on February 18, 2010, 05:37:45 PM Personally...i'd just install things to where you want them.
Exactly!Right. The days of portable programs is largely over, though there are some simple programs which do not use the registry.
Plus, after you jump through all those hoops to rewrite the registry entries, modern programs write to Documents and Settings as well, so you will not get many programs to be self-contained in their program folder.
|