PDA

View Full Version : REG_MULTI_SZ values


csd214
03-03-2005, 05:32 AM
The help doc tells: "For values of type REG_MULTI_SZ, a string will be returned where each registry entry string is separated by a "|" character."

I have difficulties with reading these kinds of values; my SUF70 app (v7.0.2.0) only reads the first string. (I have WinXP Pros SP2).

:huh

csd214
03-03-2005, 10:15 AM
BTW, the value I'm looking for is "PendingFileRenameOperations". When I try the 'Import Regystry value' feature, the same thing occurs: Only the first line of the data is imported. (I have always three lines after a reboot (one file and two directories).

SUF6NEWBIE
03-04-2005, 12:06 PM
I have tested the reading and writing of value 'PendingFileRenameOperations' and using the 'import registry value' advanced function or import reg file and all appears correct at my end..the full string is being read into action
editor and correct registry entries are written OK when App is run.

displaying in a dialogbox displays the full string as mentioned in the help docs.

Not sure what\how you have attempted actions at your end


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager]

"PendingFileRenameOperations"= yada|yada|yada

csd214
03-04-2005, 12:19 PM
Unbelievable!

A Registry view displays:
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1\ppbint.ini

\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1

\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old

-------
My app shows:

To be deleted on reboot:
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1\ppbint.ini
LEN of string: 63
Right 10 chars: ppbint.ini

I use this
lsValue = "PendingFileRenameOperations";
lsData = Registry.GetValue(HKEY_LOCAL_MACHINE, lsRegKey, lsValue, true);

Debug.Clear();
Debug.Print("To be deleted on reboot:\r\n");
Debug.Print(lsData.."\r\n");
Debug.ShowWindow(true);

lnLen = String.Length(lsData);
Debug.Print("LEN of string: "..lnLen.."\r\n")
lsRight10 = String.Right(lsData, 10);
Debug.Print("Right 10 chars: "..lsRight10.."\r\n");

What's wrong with my computer (or me...)

SUF6NEWBIE
03-04-2005, 12:33 PM
Starting to wonder if there is something 'wrong' with your installation
or settings in SUF7...

If all else fails it may be worth the effort to Completely Uninstall SUF7..
and allow the removal of 'preferences etc..Restart the Computor
and fresh install Suf7..do not change any default settings..then install
the 7020 update..then setup preferences etc, sounds dramatic however...

csd214
03-04-2005, 01:47 PM
Starting to wonder if there is something 'wrong' with your installation
or settings in SUF7...
Yes, I'm wondering... (Don't "ask" me to format the C-drive.)

Problem#1: On Shutdown was skipped, caused me som hours of working; but was my own fault not observerving the error code #5.
Problem#2: Screen.End() etc; an SUF70 internal incompability; but you solved the problem.
Problem#3: The buttons in a multilingual app; I'm still not sure why.

It is Friday evening local time; I have to pay some attention to my dear wife. Maybe tomorrow...
:eek: :) :)

SUF6NEWBIE
03-04-2005, 01:52 PM
..its past my bedtime...18 holes of golf to play tomorrow..

Formula 1 GP in Melbourne this weekend ..gonna watch it !!! :D

csd214
03-06-2005, 03:34 AM
I have NOT reinstalled SUF70. It has turned out that my problem #1-#3 was NOT caused by a faulty installation. My problem; or challenge; #4 is still unresolved:

I ran a SUF70 setup with File.DeleteOnReboot. These lines were properly added to "PendingFileRenameOperations". Registry view:
\??\C:\WINDOWS\Test Quick Launch\uninstall.exe

\??\C:\WINDOWS\Test Quick Launch\Setup Log.txt

\??\C:\WINDOWS\Test Quick Launch\Uninstall Log.txt

\??\C:\WINDOWS\Test Quick Launch
My SUF70 app "Reverse Delete On Reboot" still displayed the first line only. If I manually delete the "Test Quick Launch" lines, I get a system warning:

Data of type REG_MULTI_SZ cannot contain empty strings. Registry Editor will remove all empty strings found.

The registry view changes to
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1\ppbint.ini
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old

Now my app reads
To be deleted on reboot:
\??\C:\WINDOWS\System32\spool\drivers\W32X86\2\Old \1\ppbint.ini|\??\C:\WINDOWS\System32\spool\driver s\W32X86\2\Old\1|\??\C:\WINDOWS\System32\spool\dri vers\W32X86\2\Old
LEN of string: 167
Right 10 chars: 2X86\2\Old
but the delete on reboot will NOT be executed.

To eliminate the effect of local settings, I changed the locale to English (US) (and I have WinXP Pro SP2 English). The same result occurred.

I have no problem with other REG_MULTI_SZ values. "ObUnsecureGlobalNames" in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel shows up like this:
netfxcustomperfcounters.1.0|SharedPerfIPCBlock|Cor _Private_IPCBlock
LEN of string: 67
Right 10 chars: e_IPCBlock
The string separator is ASCII 124 as the help doc states.

So far, SUF6NEWBIE is the only person who has told me about successful reading of "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", Value "PendingFileRenameOperations". I should appreciate other reports from forum members out there. I have attached the sf7 project (you need to have the latest version of SUF70 v7.0.2.0 installed), or you can download a prebuild exe; ready to run; here (http://www.positivdata.no/filer/Reverse_Delete_On_Reboot.zip) (zip file).

No registry modification is done; just reading.

TIA.

(I need the "File.ReverseDeleteOnReboot" action in this scenario:
The user runs Uninstall (with delete on reboot). Without rebooting, he runs the Setup. The next day he has no uninstaller!)

SUF6NEWBIE, what happened with Michael Schumacher?

Corey
03-06-2005, 03:37 AM
18 holes of golf to play tomorrow...
Sounds awesome! You're a lucky guy... :yes

csd214
03-06-2005, 02:35 PM
I forgot to tell; the project in post #8 includes SUF6NEWBIE's function Hex2Asc() (previously published). The function is handy if you want to read a registry value of type REG_BINARY. (I have just added enumeration of availabled CD-ROM drives; the function gets info about the devices.)

csd214
03-11-2005, 02:06 PM
No body? :rolleyes

SUF6NEWBIE
03-12-2005, 02:05 AM
Ok ..what is occurring is that only the first 'line' of the value can be read
"pendingfilerenameoperations"..under the below condition.

so two filedeleteonreboot(TempLaunchFolder.."\\irsetup.exe" ....) actions

because of the way they are written to the registry(new line and blank line)

this is usually done to ensure there is no overwriting of a previous entry and
to keep them separate (regedit ..states spaces must be removed)..normal
behaviour.

you would need to change the way the action is written..
potentially dangerous for correct operation...

it all depends on the way the data was originally written..
so, if it is written in standard multi_sz then can be read fine.

this particular 'value' is treated differently by the OS and programs
that write to it..I would not recommend getting fancy with string manipulation
to work around it..I have actually done this in the past, however just
not worth the effort etc.

HTH

csd214
03-12-2005, 03:24 AM
SUF6NEWBIE, Thanks! You seem to be the only person who responds to my cry of distress. I'm working with a generic subroutine I want to use in several of my installers. If I'm not able to read the data properly, I can never go through with my project.

you would need to change the way the action is written..
potentially dangerous for correct operation...

it all depends on the way the data was originally written..
so, if it is written in standard multi_sz then can be read fine.

I don't really understand. I use the standard action File.DeleteOnReboot() (and it works properly as it always has). I don't want to perform some potentially dangerous hocus-pocus stuff.

I only need to READ the data:
Registry.GetValue(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager", "PendingFileRenameOperations", true);
I'm NOT going to modify anything.

The help doc tells, "For values of type REG_MULTI_SZ, a string will be returned where each registry entry string is separated by a "|" character.", but that is not true when reading this "special" (?) value.

(If I manually remove the blank lines the items are not deleted at all on reboot.)

I was hoping for an answer from the I.R. team; I imagined that my question was of common interest. If nobody can state a solution here, I'm going to post a support ticket (Are you listening Adam? :D ).

BTW, I'm happy with your confirmation, SUF6NEWBIE, that my computer isn't unhealthy…

SUF6NEWBIE
03-12-2005, 03:39 AM
Yep, the way the data is written in 'pendingfilerenameoperations'
determines wether you can read all data in it,
for every action deletefileonreboot(...
if there is already an entry in the Value, the 'next data is wrtten
with a blank line and then the actual reboot action code

..if this is the case ..you can not Reliably Read every line or ALL data in the Value...
(registry.getvalue..will not return all the data.)

if the data is written in this format ........|.........| then all can be read.

I do believe that this Value is a 'special case',

..you will notice that if you export the reg data it is 'written in hex' with an
id code at the beginning...I would imagine there would be another way to
achieve what you want and to be honest I'm not sure I know what you are
trying to achieve. ? :)

SUF6NEWBIE
03-12-2005, 04:06 AM
To put it another way..if you don't want to make your own entries,
why do you need to Read it in the first place, you should know if the
actions are present..if the value does not exist when you start your
on reboot actions, and then if the value exists, you know whats up..

I know one issue is if the User does something that causes another entry
entry to be written to this value, or cause 'Value to be 'created by the OS.

just thinking out load..

csd214
03-12-2005, 04:16 AM
"What I want" is quite simple:
a) The installer has a routine uninstalling the previous version of the app (if it exists). The Auto.Uninstall() is executed as the first action 'While Installing*
b) The uninstaller has a generic script ('On Shutdown') that deletes uninstall.exe and Setup Log.txt and Uninstall Log.txt on reboot. If the uninstaller is called from the installer (item a), these scripts should not be executed.

If the installer detects that the delete on reboot items exist in "PendingFileRenameOperations", the user should be asked to reboot before installing the app. (The user may have ran the uninstaller manually.) Preferabaly I should be able to remove the pertinent items from "PendingFileRenameOperations", but I dare not maninpulate the string in this value. I treat the Registry with respect.

you should know if the actions are present
No, I can't know whether the user has ran the Uninstaller before he starts the Setup (without reading the key value). Well, I could create a file "The User has uninstalled your Excellent App.txt" and delete this file on reboot…

SUF6NEWBIE
03-12-2005, 04:22 AM
Yep.. I understand more clearly, could you create a registry entry
in HKLM\software\MyApp\data\uninstall = 1

or similar..forget the 'pendingfilerenameoperations' 'Read altogether and
go on what you create in eg: HKLM\software\MyApp\data\uninstall = ?

what this value is determines how you would like to control further actions etc. Just an idea.

by coding in detection of your App Registry key into Installer and Uninstaller
..depending on MApp\value(if exists) and go from there..make your 'cleanup'
code 'independant' ..but still driven by your App value(if exists).

csd214
03-12-2005, 04:42 AM
The registry entry solution: The value has to be modified by the OS ("on reboot") to function.

Your help; and your 'thinking load'; has been most helpful for a work around. The file solution I mentioned should probably work.

Still I want the Registry.GetValue() to be usable. Then I could execute File.DeleteOnReboot() "with a negative sign"; like a File.UndeleteOnReboot action.

SUF6NEWBIE
03-12-2005, 04:46 AM
good exercise for the Brain :yes

..you'll make it work I'm sure..

as it is with IR coding.."Still I want the Registry.GetValue() to be usable."
you can not reliably read the reboot actions value..so I personally can't
see the point in relying on it..but that's just my 'brain' :)