Jump to content











Photo
- - - - -

RegAddBoot script updates


  • Please log in to reply
93 replies to this topic

#51 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 26 November 2009 - 10:10 PM

at this moment I do not think that "0x2" (REG_EXPAND_SZ string) would be useful for all ones as "RegAddBoot" replacement. :)
Maybe it could be useful with some "simple" program/function (some program file type association?), but unfortunely it does not seem to me that it could be "widely" used.


Hi online,

I guess We fully agree (no confrontation), RegAddBoot should be used for cases where Reg_Expand_Sz do not work. I tend to check first :rofl:

Besides i do not like file associations with regaddboot, such a beautiful function with unneccasary usage.... well you know the story and I guess we agree :thumbup:

#52 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 28 November 2009 - 08:29 AM

But a pre-loader is an interesting idea. I actually have a post-loader running in VistaPE fixing one loader bug. Now all I need is time...

@JonF
may i ask is there any progress?

#53 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 28 November 2009 - 01:23 PM

Hi online,

I guess We fully agree (no confrontation), RegAddBoot should be used for cases where Reg_Expand_Sz do not work. I tend to check first :thumbup:

Besides i do not like file associations with regaddboot, such a beautiful function with unneccasary usage.... well you know the story and I guess we agree :thumbup:

Hi Lancelot,
I can assure that "no confrontation" at all from my side, only opinions. :rofl:
Sure, if I can learn that about the file-type-association then the REG_EXPAND_SZ forcing was almost always or even only often working then it would be interesting, but I still did not understand if it is so or not...
In that case a kind of public list/archive about the programs/scripts that are working in that way would be interesting too (although not strictly useful about the new programs/scripts).
Meanwhile, I still can get the reason (Galapo's one too) not to use a function (RegAddBoot) and to spend further time in order to try if the 0x2 forcing was working or not for that (every) specified script.
If you said to me that using widely the "RegAddBoot" (when really needed) function then the system became "overloaded" then I can understand the reason itself, but if it does not overload anything (just as I guess) then I still can not see the reason to avoid its (very handy and very working) use.

By the way, just as an example: in a my own 7-Zip script there are the following RegAddBoot entries that I wrote without testing if the 0x2 forcing was working or not
RegAddBoot,HKU,0x1,.DEFAULT\Software\7-Zip,Path,#$pSystemDrive#$p\Program#$sFiles\7-ZipRegAddBoot,HKLM,0x1,SOFTWARE\7-Zip,Path,#$pSystemDrive#$p\Program#$sFiles\7-ZipRegAddBoot,HKLM,0x1,SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32,,#$pSystemDrive#$p\Program#$sFiles\7-Zip\7-zip.dllRegAddBoot,HKLM,0x1,SOFTWARE\Microsoft\Windows\CurrentVersion\App#$sPaths\7zFM.exe,,#$pSystemDrive#$p\Program#$sFiles\7-Zip\7zFM.exeRegAddBoot,HKLM,0x1,SOFTWARE\Microsoft\Windows\CurrentVersion\App#$sPaths\7zFM.exe,Path,#$pSystemDrive#$p\Program#$sFiles\7-ZipRegAddBoot,HKLM,0x1,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\7-Zip,UninstallString,#$q#$pSystemDrive#$p\Program#$sFiles\7-Zip\Uninstall.exe#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.7z\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c0RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.7z\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.bz2\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c2RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.bz2\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.bzip2\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c2RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.bzip2\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.cab\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c7RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.cab\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.cpio\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c12RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.cpio\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.deb\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c11RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.deb\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.dmg\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c17RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.dmg\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.gz\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c14RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.gz\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.gzip\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c14RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.gzip\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.hfs\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c18RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.hfs\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lha\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c6RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lha\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lzh\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c6RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lzh\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lzma\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c16RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.lzma\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.rpm\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c10RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.rpm\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.split\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c9RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.split\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.swm\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c15RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.swm\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.taz\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c5RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.taz\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tbz\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c2RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tbz\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tbz2\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c2RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tbz2\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tgz\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c14RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tgz\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tpz\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c14RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.tpz\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.wim\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c15RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.wim\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.xar\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c19RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.xar\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.z\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c5RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.z\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$qRegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.zip\DefaultIcon,,%SystemDrive%\Program#$sFiles\7-Zip\7z.dll#$c1RegAddBoot,HKLM,0x1,SOFTWARE\Classes\7-Zip.zip\shell\open\command,,#$q%SystemDrive%\Program#$sFiles\7-Zip\7zFM.exe#$q#$s#$q#$p1#$q
The above are 56 lines and I do not mind about them... and it seems to me that then either the function and the system work very well without any kind of issue.
So, I really cannot see the reason to try (spending time) if the REG_EXPAND_SZ forcing was working or not: please note that I call it a "forcing" because I see it just as a forcing...
Only my opinions, of course... :) :rofl:

#54 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 28 November 2009 - 02:22 PM

I feel there is a misunderstanding online (probably caused by me), there is no need to force users to use 0x2 value with regaddboot.

If you said to me that using widely the "RegAddBoot" (when really needed) function then the system became "overloaded" then I can understand the reason itself, but if it does not overload anything (just as I guess) then I still can not see the reason to avoid its (very handy and very working) use.

When really needed it is best to use. Using when not really needed overloads the expenvvar.txt which would increase boottime :) (imagine if it is tooooo much used). Besides it is unneccasary.

As a result for especially file associations (and when available with other registry entries) it is better to use reg_add,0x2 instead of regaddboot (0x1 or 0x2). So we can say forceing to use reg_add,0x2 when available is better than using regaddboot :thumbup:

So, I really cannot see the reason to try (spending time) if the REG_EXPAND_SZ forcing was working or not: please note that I call it a "forcing" because I see it just as a forcing...

Reason is, one should test if reg_add,0x2 is working or not. If it does not work than regaddboot, if it works than better to use forced reg_add,0x2 (I guess you would agree that making required registry addings at build time would be better than making at boot time)

#55 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 November 2009 - 02:58 PM

Maybe instead of discussing single issues, we first try to understand the background.
(This also concerns the Reg2WBS topic and some PMs with Lancelot and Online).

MHO (My Humble Opinion):

In the registry there are a lot of paths, e.g. for drivers etc. Let me use a diver as sample.
When you author a script, you define the path to the driver usually with "X:\i386\system32\drivers\mydriver.sys"

Some Dinosaur programmers, me included, refuse the hardcoded path:
  • Nobody knows, whether the PE's system drive will really be X:
  • Nobody knows, whether the PE's windows directory will really be I386
  • ...
Therefore it seems to be a good solution to use environment variables like
  • %SystemDrive%
  • %SystemRoot%
To use such variables, you have to change your registry entry from 0x1 to 0x2.

But now the real issues comes up:
Nobody knows the rules how 0x2 entries are resolved during boot time.
To look into every registry entry and decide whether an environment variable has to be resolved, would slow the boot remarkably.
IMH(unproofed)O Billy the Door looks only into a special list of entries and resolves them (e.g. Explorer folders)
But this list is "Unknown" and maybe some of your variables may remain unresolved ...
(Similar issue, which I do not want to explain here, too: You only use the path relative to your windows directory)

If the "0x2" method does not work, RegAddBoot can be a good solution.

But we really should use it only when the above mechanisms do not work.
And when we use it, it must be sure that at that time during boot all necessary environment variables are already known.
Perhaps it could be wise to include the RegAddBoot mechanism into EarlyStarter ...

Peter

BTW: No issue for me to change Reg2WBS in the test phase on a daily base :)

Peter

#56 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 28 November 2009 - 03:12 PM

Perhaps it could be wise to include the RegAddBoot mechanism into EarlyStarter ...

Good suggestion -- I had the exact same thought earlier today also!

Regards,
Galapo.

#57 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 28 November 2009 - 03:22 PM

Sorry that I did not recognize it!

I'm currently a bit busy.



Peter

Not sure where the post went to that I'm replying to.

My idea was simply in my head and I hadn't had time to post about it. You beat me to it.

#58 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 November 2009 - 03:26 PM

Not sure where the post went to that I'm replying to.

My idea was simply in my head and I hadn't had time to post about it. You beat me to it.

After I wrote my reply I saw your "same thought", and I deleted my post.

You cought it within these some seconds!

Peter :)

#59 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 28 November 2009 - 03:43 PM

Actually, it has been a long time since I can remember ANY case of an application that works under either XP or Vista that does not work with REG_EXPAND_SZ entries using environment variables to point to an executable or default icon. Are there really any still around? The actual impediment to using it in all cases seems to be that not all PE's have a consistent program location variable equivalent to the %SystemDrive% and %SystemRoot% variables.

If RegExpVar is used for the RegAddBoot process, it appears that the path entries all get converted to literals prior to entry into the registry in any case, regardless of whether they are scripted as 0x2 or 0x1 entries. So that's largely a question of efficiency and boot-up timing.

#60 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 November 2009 - 04:07 PM

Actually, it has been a long time since I can remember ANY case of an application that works under either XP or Vista that does not work with REG_EXPAND_SZ entries using environment variables to point to an executable or default icon.

Maybe the "quality" of my English language prohibited me to understand fully:

Does that mean
"I do not remember any 0x2 registry entry where any environment variable is not understood correctly" ?

In that case the question to Galapo:
What is the reason to write such an unnecessary script?

Peter :)

#61 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 28 November 2009 - 04:45 PM

Not sure about ANY, but the most common usage of 0x2 (REG_EXPAND_SZ) registry entries is to allow environment variables to be used in locating executables (EXEs and DLLs) and default icons (often numerically identified within an executable). I suppose there may still be a few "old clunkers" around, but I can't recall seeing any recent cases under either XP or Vista where that doesn't work just fine. In fact, there are some CurrentControlSet instances where ImagePath entries just use relative paths (e.g., system32\DRIVERS\ACPI.sys) but they're not really relevant to this discussion.

The large majority of REG_EXPAND_SZ registry entries are based on the %SystemDrive% or %SystemRoot% environment variables, but there certainly are some that use %ProgramFiles% such as the entry for WordPad in most Windows installations. In any case, it would have to be a variable available to the shell on start-up. Other than that consideration, however, I've not seen any other restriction that would prevent the general approach from being widely used -- EXCEPT, as I say, the fact that there is no "across the board" program location variable applicable to all PE variants. Where there are "Run from RAM" options for individual applications, that can also, of course, add to the complexity of any "one size fits all" solution. Some kind of logical "decision tree" may be possible.

P.S.: Your English is just fine. Sometimes my comments may be less explicit than they should be in providing relevant details.

#62 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 28 November 2009 - 04:52 PM

That proofs the opinion I have had until now.

But following some ??? of the last days, I think that my pseudo-poll is understandable.

As asked in my last post:

@Galapo:

Arvy does not see remarkable issues in resolving the 0x2, as well as I do.

What was the trigger to invent the RegAddBoot script?

Peter

#63 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 28 November 2009 - 08:38 PM

@Arvy
We are proud to have you in the porcupine community Team.
Some of porcupines have also some nicks, Peter is the senior porcupine, The guru porcupine. I like being turtle porcupine :thumbup:
Also some porcupines have some clubs too, Like "Porcupine fight club" :rofl: Sometimes we have "Porpucine Gladiators" :thumbup:
I feel you will be a good member of "Porcupine fight club" :rofl:

@Galapo:

Arvy does not see remarkable issues in resolving the 0x2, as well as I do.

What was the trigger to invent the RegAddBoot script?

Peter


Hi Peter,

as written many times before on this topic, there are some RARE cases where using env. variable with 0x2 is not available. With a quick check on an old copy of LiveXP ( you can get a copy here ), There are only 11 entries where RegAddBoot exists in LiveXP project.
Example:
RegAddBoot,HKLM,0x1,Software\EasyBoot Systems\UltraISO\5.0,,%PE_Programs%\%ProgramFolder%
RegAddBoot,HKCU,0x1,Software\EasyBoot Systems\UltraISO\5.0,,%PE_Programs%\%ProgramFolder%

And verrrry Rarely, dll registration at bootup cause reg_add at build fail. (dll registration overwrites reg adding at build time)
Example:
RegAddBoot,HKLM,0x1,Software\Classes\Unknown\Shell,,Notepad

Well as written mannny times, regaddboot is not required much on LiveXP, currently I am waiting the answer of "The Question" to make further changes.

But a pre-loader is an interesting idea. I actually have a post-loader running in VistaPE fixing one loader bug. Now all I need is time...

@JonF
may i ask is there any progress?



#64 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 28 November 2009 - 09:22 PM

@JonF
may i ask is there any progress?

Well, I have an operating pre-loader, but so far it is unable to affect the root environment. It may be that the environment can't be affected before the shell is loaded. I'm still experimenting.

#65 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 28 November 2009 - 09:28 PM

What do you mean by: 'is unable to affect the root environment' ?

:thumbup:

#66 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 29 November 2009 - 01:06 AM

What do you mean by: 'is unable to affect the root environment' ?

If I add a REG_SZ named CDDrive and containing "D:" to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment, call the AutoIT envupdate function, start the Explorer shell, start a CMD window, and type "Set", then CDDrive does not appear.

If I do the same thing except use dllcall instead of envupdate, the program crashes. Obviously my error, but I haven't yet figured out what's wrong.

If I execute "setenv -m CDDrive D:", start the Explorer shell, start a CMD window, and type "Set", then CDDrive does not appear. If I then type "setenv -m CDDrive D:" followed by "set" then CDDrive appears.

I haven't tried any other possibilities yet.

#67 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 29 November 2009 - 02:18 AM

@JonF: You might consider Window's own setx.exe -- http://technet.micro...104(WS.10).aspx

Setx, in the case of system variables, basically does what you've tried with the session manager and then broadcasts the changes so that it doesn't need a system restart for propagation. It can thus add and change system and/or user variables while the session is running.

It may also be worth noting that the PE Shell Swapper has the ability to set and propagate an environment variable.

However, to be universally effective at start-up, you'd really need to get that envvar into the session manager's registry entries before initialisation somehow. Is it not possible for vistape.cfg to handle that singular session manager setting in lieu of all those other %CDDrive% entries it currently handles for individual items? If either it or your own pre-loader does so early enough, most of the latter could then use that system environment variable except for those few cases where their own individual RegAddBoot entries might actually be necessary.

I'm sure my simple minded analysis must be overlooking some impediment. What am I missing?

__

I feel you will be a good member of "Porcupine fight club" :thumbup:

Thanks for the welcome and invitation. Actually I've been around for a while, although not so much recently. However, I usually try my best to stay clear of situations where porcupines (or people) are in a defensive mood. I find that it seldom results in the most rational decisions developmentally or otherwise -- not to mention my aversion to sharp quills. :thumbup:

#68 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 29 November 2009 - 05:55 AM

i think also the setx.exe - like the 'EnvUpdate()' AutoIT function
can work only in that case if it is executed after the shell is already started
and can work only in the Explorer shell and cannot in BS Explorer
(and setx.exe is available only from the '%InstallSRC%'),
at least that is my experience in a current VistaPE CAPI build

#69 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 29 November 2009 - 07:26 AM

What was the trigger to invent the RegAddBoot script?

if i am right originally Galapo made his ExpEnvVar.exe for his UltraISO script,
ultraiso
IZArc
ExpEnvVar thread

i think the main reason was the interproject compatibility
here and here and finally:
http://www.boot-land...?...ost&p=48412

maybe i am wrong but if remember correctly
i had problem using 'REG_EXPAND_SZ' also in WinRAR, Acronis True Image (not in the BartPE version but in the full version), Mozilla Firefox, Java JRE

#70 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 29 November 2009 - 01:53 PM

Setx, in the case of system variables, basically does what you've tried with the session manager and then broadcasts the changes so that it doesn't need a system restart for propagation. It can thus add and change system and/or user variables while the session is running.

So does AutoIT's envupdate and setreg.exe.

However, to be universally effective at start-up, you'd really need to get that envvar into the session manager's registry entries before initialisation somehow.

That's the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment entry I've dbeen doing.

#71 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 29 November 2009 - 01:56 PM

What was the trigger to invent the RegAddBoot script?

Only NightMan knows for sure, he's the one who invented it. When Pedro started Common API, he had to support it because so many scripts used it.

I presume that NightMan realized it is needed, or at least could be needed and it's impossible to prove it's never needed without enumerating all existing software, and put it in his versionof teh API.

#72 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 29 November 2009 - 02:45 PM

That's the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment entry I've dbeen doing.

Understood. But your comments about using the EnvUpdate function made me think that you were trying to resolve some post-initialisation problems with the propagation of that system variable.

Propagation rather than setting is also the problem with my own suggestion, BTW. There's no difficulty at all in setting any HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment entry via the vistape.cfg route. However, the initialisation sequence appears to be such that it does not get propagated as a system variable when that method is used. It will definitely require something such as your proposed pre-loader that occurs earlier during start-up process, following quite soon after identification of the %CDDrive% letter.

#73 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 29 November 2009 - 02:54 PM

@JonF
Maybe useful :thumbup::
http://www.boot-land...?...c=9128&st=5

:thumbup:

jaclaz

#74 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 29 November 2009 - 03:34 PM

Has anyone ever checked where setx actually stores it's data?
There are two places for environment variables, one in CurrentControlSet and one in CurrentUser, but at least the XP PE, only ever use the values of the CurrentControlSet.

So if SetX and Autoit write to CurrentUser, it will never work in PE.

:thumbup:

#75 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 29 November 2009 - 03:50 PM

Oh i see SetX works as a Explorer Addon, not a true Systemtool.
So without a running Explorer it's useless.

:thumbup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users