exactly that is the caseSo without a running Explorer it's useless
RegAddBoot script updates
#76
Posted 29 November 2009 - 03:52 PM
#77
Posted 29 November 2009 - 04:44 PM
did you try to modify the value 'CmdLine' in the key 'HKLM\SYSTEM\Setup' in the VistaPE registry
not point to the 'winpeshl.exe'
but point to your complied AutoIT pre-loader which try to set the 'cddrive' first,
then call the winpeshl.exe after this 'cddrive' was written to the registry key 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'?
#78
Posted 29 November 2009 - 05:17 PM
On my XP host this runs well:... AutoIT pre-loader which try to set the 'cddrive' first,
then call the winpeshl.exe after this 'cddrive' was written to the registry key 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'?
- Add a new variable to '...\Session Manager\Environment'
- Run BroadcastEnvChange /broadcast
- Open a cmd window
- See the new variable in 'Set'
Peter
#79
Posted 30 November 2009 - 01:23 AM
#80
Posted 01 December 2009 - 01:37 PM
Now what?
#81
Posted 01 December 2009 - 01:59 PM
and Dera
yipppiyeeeyaaayooooooo
Now what?
I guess time to change capi for vistape ?
btw reminding:
LiveXP (bootsdi builds giving example with filezilla script by using enu source):
runfromram enabled ==> filezilla is in .img file at X:\Program Files RAM\Filezilla
runfromcd enabled ===> filezilla is on cd at ??:\Program Files CD\Filezilla (??=%PEdrive% at env variables)
rundefault enabled ===> filezilla is in .img file at X:\Program Files\Filezilla
a similar mechanism at capi can be made on vistapecapi ??
what you think ?
Edit 2010-03-28:
I decide to add paraglider's useful info here for future reference after this topic
Just making the registry value REG_EXPAND_SZ does not automatically ensure the environment variables get expanded when read. RegQueryValueEx does not expand them. Its still up to the caller to call ExpandEnvironmentStrings on the returned value to expand it.
However if the registry is read with RegGetValue ( only supported on Vista or later ) then by default the environment variables are expanded - this can be suppressed with the RRF_NOEXPAND option.
SHRegGetValue does expand environment variables unless SRRF_NOEXPAND is specified.
#82
Posted 01 December 2009 - 11:24 PM
Can you fill us in on what that method is so we have the method documented for reference?I decided to useh a method that Dera PM'd me, since it uses a little less RAM than my method. (Thanks, Dera).
Thanks,
Galapo.
#83
Posted 02 December 2009 - 12:39 AM
Well, my way was to point to a compiled AutoIT program in winpeshl.ini. This program added CDDrive to its local environment and ran vpeldr.exe which in turn ran the appropriate shell, each getting a copy of the environment containing CDDrive. Of course the compiled AutoIT program remained resident, using about 5 MB. (If I killed the compiled AutoIT process, the system soon rebooted).Can you fill us in on what that method is so we have the method documented for reference?
Dera's way was to point to a .cmd file in CmdLine in HKLM\Setup. This file ran a compiled AutoIT program which put CDDrive in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and ran the envupdate function (which cmd.exe {which was activated to run the .cmd file} listened to and updated its environment). The AutoIT program exited and next the .cmd file ran winpeshl.exe which ran vpeldr.exe (specified in winpeshl.ini) which started the shell, each receiving a copy of cmd.exe's environment containing CDDrive. Of course this left a portion of cmd.exe resident, using about 1.5 MB.
#84
Posted 02 December 2009 - 12:52 AM
Thanks, I understand now how you got it to work.
You could still use just your AutoIt program and use this memory reduction function. Should take the usage down to about 0.7mb. Call it your loop.
While 1 Sleep(500) _ReduceMemory() Wend Func _ReduceMemory() Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId') Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0]) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Return $ai_Return[0] EndFunc
Regards,
Galapo.
#85
Posted 02 December 2009 - 08:14 AM
Interesting. I'm very curious about that part of your process. Perhaps you'd be willing to show us your PreLoader.au3 script file. Whatever method Nightman was using to establish his %CDDrive% envvar for VistaPE's RegAddBoot process, it seems quite transient and not available at that point in any case. I found that I had to do something like this:This file ran a compiled AutoIT program which put CDDrive in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and ran the envupdate function ...
#NoTrayIcon $cddrv = EnvGet("CDDrive") $drives = DriveGetDrive("ALL") If NOT @error AND NOT $cddrv Then For $i = 1 to $drives[0] $flagfile = $drives[$i] & "\vistape.cfg" If DriveStatus($drives[$i]) <> "UNKNOWN" AND DriveStatus($drives[$i]) <> "NOTREADY" Then If FileExists($flagfile) Then $cddrv = StringUpper($drives[$i]) ExitLoop EndIf EndIf Next EndIf RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment", "CDDrive", "REG_SZ", $cddrv) EnvUpdate()
#86
Posted 02 December 2009 - 08:39 AM
(anyway i used this au3, only corrected 'REG_EXPAND_SZ' into 'REG_SZ'
and that was my experience:
if the complied au3 ran before the winpeshl.exe via "HKLM\Setup","CmdLine","mycommand.cmd" then the EnvUpdate() not needed at all
and it works also in BS Explorer building only from the WAIK,
if "HKLM\Setup","CmdLine", "winpeshl.exe" used and the complied au3 ran before the vpeldr.exe via the winpeshl.ini [LaunchApps] section
then EnvUpdate() doesn't help)
#87
Posted 02 December 2009 - 08:53 AM
#88
Posted 02 December 2009 - 08:59 AM
(i am not able to write code)
and for me Pedrole15's au3 can find the tag file also on the UFD
#89
Posted 02 December 2009 - 09:05 AM
#90
Posted 02 December 2009 - 09:11 AM
i mean the text in the code box in Pedrole15's original post,
not Max's attachment
#91
Posted 02 December 2009 - 09:38 AM
In any case, what I was really curious about were JonF's final methodological approach for determining the drive letter variable to be entered into the registry and his placement of that part of his process into the overall VistaPE start-up sequence.
As you point out, the latter factor appears critical to the ultimate impact (if any at all) of the EnvUpdate() function. I'm puzzled about why it should be necessary to keep it in memory if the session manager is actually able to establish it subsequently as it does with all the other entries that are held under the same environment key in the registry.
#92
Posted 02 December 2009 - 01:51 PM
AFAIK NightMan never created a CDDrive environment variable. He replaced %CDDrive% with the appropriate drive letter as he created the shortcuts, on the fly. But he forgot to do that for the arguments portion of the shortcut specification.exactly which script in the VistaPE project was updated?
(anyway i used this au3, only corrected 'REG_EXPAND_SZ' into 'REG_SZ'
and that was my experience:
if the complied au3 ran before the winpeshl.exe via "HKLM\Setup","CmdLine","mycommand.cmd" then the EnvUpdate() not needed at all
and it works also in BS Explorer building only from the WAIK,
if "HKLM\Setup","CmdLine", "winpeshl.exe" used and the complied au3 ran before the vpeldr.exe via the winpeshl.ini [LaunchApps] section
then EnvUpdate() doesn't help)
My code is contained inb the script, but here it is:
$CfgFile = "vistape.cfg" $CDLetter = False $Letter = DriveGetDrive("all") For $L = 1 To $Letter[0] If (StringRegExp($Letter[$L], "(?i)^(A|B):$")) Then ContinueLoop If (StringRegExp(DriveStatus($Letter[$L]), "READY") <> 0) Then If FileExists($Letter[$L] & "\" & $CfgFile) Then $CDLetter = StringUpper($Letter[$L]) ExitLoop EndIf EndIf Next If $CDLetter Then RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment","CDDrive","REG_SZ",$CDLetter) ; Not many apps listen to this broadcast, but cmd.exe does. So this program ; should be run in a .cmd file so cmd.exe will listen and maintain the environment ; variable after this program exits. EnvUpdate() EndIf
#93
Posted 02 December 2009 - 01:52 PM
07-config.script. I may have messed up the update; try downloading now.exactly which script in the VistaPE project was updated?
#94
Posted 02 December 2009 - 04:20 PM
ok, now i can see the updated scripts
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users