/build/static/layout/Breadcrumb_cap_w.png

Append Registry

I'm trying to append a value on to the following REG_EXPAND_SZ key in a .MST

\\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath

This key holds all of the paths for driver searches. I want to append

;%SystemRoot%\mypath

To the end of the key. I've created the key in Wise and used [~] to indicate I want it to append. The value field in the registry table looks like

#%[~];%SystemRoot%\mypath

However, when I run the package instead of appending to the old key it replaces the key with a REG_MULTI_SZ key consisting of one blank line and then

;%SystemRoot%\mypath


I could do it with a VBScript but I'd rather not. For reference I am trying to follow this article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/registry_table.asp


Any Ideas what I'm doing wrong?

0 Comments   [ + ] Show comments

Answers (13)

Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
I don't think it's possible. I think the [~] will always make it be interpreted as a multi-string.

Try using an "AppSearch" to read the initial value into a property, then append your new path to the end.

Unfortunately, this solution doesn't deal with the eventuality that the string was already there!
[:(]
Posted by: xythex 18 years ago
Orange Senior Belt
0
Thanks, that worked. Unfortunatly, it doesn't remove the value on uninstall but I don't think it matters if dead paths remain in that key. I am surprised that windows installer does not have a way to deal with appending registry entries to strings.
Posted by: VikingLoki 18 years ago
Second Degree Brown Belt
0
Well, keep in mind that the only reason why path strings still exist is for backwards compatibility. It's kinda silly to add functionality to Windows Installer that enables it to accomodate installations from before Windows Installer existed. New apps shouldn't use path strings and old apps never used Windows Installer.

It's just that poor packager who's handed "Whatever 95" and told to make it into one of those neat new package thingys. [:D]
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
ORIGINAL: VikingLoki

Well, keep in mind that the only reason why path strings still exist is for backwards compatibility. It's kinda silly to add functionality to Windows Installer that enables it to accomodate installations from before Windows Installer existed. New apps shouldn't use path strings and old apps never used Windows Installer.

It's just that poor packager who's handed "Whatever 95" and told to make it into one of those neat new package thingys. [:D]


What??

This thread is about Windows Installer support for the "REG_EXPAND_SZ" registry type and indirectly about the "OemPNPDriversPath" registry key (because it is of "REG_EXPAND_SZ" type).

Are you saying that MS is intending to make the "REG_EXPAND_SZ" registry type obsolete?
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
ORIGINAL: xythex

Thanks, that worked. Unfortunatly, it doesn't remove the value on uninstall but I don't think it matters if dead paths remain in that key. I am surprised that windows installer does not have a way to deal with appending registry entries to strings.


The latest versions of Windows should be alright.

http://support.microsoft.com/default.aspx?scid=kb;en-us;312535&Product=winxp
Posted by: VikingLoki 18 years ago
Second Degree Brown Belt
0
Are you saying that MS is intending to make the "REG_EXPAND_SZ" registry type obsolete?

I'm saying that it IS obsolete, but it must still be supported because many legacy apps that use this registry type are still in use. Any app written today should not be using it. Don't expect this registry type to be well supported. Your old app can still use this archaic thing, what more do you want?

Note to developers: Just because REG_EXPAND_SZ registry types exist, doesn't mean you should use them. Same goes for INI files. ...and they don't go in Program Files! Windows has a standardized file location structure... Learn it, know it, use it!!

Ok, venting over.
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
That's a REAL bummer!![:@]

I won't be able to use variables in the registry anymore! I'll have to hard-code all my paths - no more "%SystemRoot%" or %Windir% for me![:D]

Thanks to VikingLoki for breaking this news to us all!! I don't suppose you have a link to webpage where we can read about this for ourselves? There must be some guidelines for developers or something like that? Or maybe you have a link to where you read it from?

I can only find this page which appears to say that "REG_EXPAND_SZ" was first introduced with Windows NT and that many older applications don't support it??[;)]

http://msdn.microsoft.com/library/en-us/apcompat/apcompat/call_expandenvironmentstrings_before_reading_reg_expand_sz.asp
Posted by: VikingLoki 18 years ago
Second Degree Brown Belt
0
Wise, you're confusing me. It's too early in the week for this... or too late in the weekend.

Ok, I've re-read this thread... I clearly have no clue what I'm talking about today. I'll try to pay better attention next time. (Man.. you are BRUTAL!)

That's what you get when you have a laundry list of apps that seem to intentionally resurrect every ounce of legacy support that XP has, and makes write calls to every place users have read-only access. What kind of developer develops an app in 2005 and not only uses INI files for everything, but also puts them in \winnt AND \windows AND \program files AND encodes the user name into the file name AND relies on the %path% variable AND wants an ODBC Data Source entry that requires our database's schema password placed on the workstation in plain text? Can this be more rediculous??
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
Sorry if I was a bit harsh! I know I can be a bit blunt at times! Although in this case I must admit I was getting my own back for the "quiz show" post where you weren't exactly "gentle" with me either![:D]

Anyway, thanks for having the decency to admit that your previous post may not have been entirely accurate![;)]
Posted by: VikingLoki 18 years ago
Second Degree Brown Belt
0
Ha! Not accurate? I thought we were talking about something ENTIRELY different. Total mental short circuit. No explanation.

Would it be inappropriate to delete all my posts in this thread and deny everything? [8|]
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
ORIGINAL: VikingLoki

Are you saying that MS is intending to make the "REG_EXPAND_SZ" registry type obsolete?

I'm saying that it IS obsolete, but it must still be supported because many legacy apps that use this registry type are still in use. Any app written today should not be using it. Don't expect this registry type to be well supported. Your old app can still use this archaic thing, what more do you want?

Note to developers: Just because REG_EXPAND_SZ registry types exist, doesn't mean you should use them. Same goes for INI files. ...and they don't go in Program Files! Windows has a standardized file location structure... Learn it, know it, use it!!

Ok, venting over.


Too late!!![:D][:D][:D]
Posted by: VikingLoki 18 years ago
Second Degree Brown Belt
0
You bastard! [>:]
Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
And you said I was "Brutal"!![:D]

Moderator! Moderator! Moderator![:(][:(][:(]
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