Register DLL
#1 Guest_Msenn_*
Posted 01 February 2008 - 02:05 PM
Unfortunately the Dll isn't registered automatically.
So I have to do it manually with 'regsvr32 Xyz.dll' under VistaPE.
How can I automatically register a Dll in a script?
#2
Posted 01 February 2008 - 05:07 PM
I use a Dll under VistaPE, that I copy per script to %TargetDir%\Windows\System32.
Unfortunately the Dll isn't registered automatically.
So I have to do it manually with 'regsvr32 Xyz.dll' under VistaPE.
How can I automatically register a Dll in a script?
Hi Msenn,
You could write a .bat file at build-time with:
FileCreateBlank,"%TargetDir%\Windows\System32\reg_xyz.bat" TXTAddLine,"%TargetDir%\Windows\System32\reg_xyz.bat","regsvr32 xyz.dll","Append"
... and read about the 'api' to find out how to make reg_xyz.bat automatically start at run-time... I'm not exactly sure what is working with your version of VistaPE.
I guess, you can place the code in any App script.
BTW, this may also apply to your earlier post about running 'wpeutil initializenetwork'.
Regards
#3
Posted 01 February 2008 - 06:21 PM
#4
Posted 01 February 2008 - 06:32 PM
Which statement is necessary depends on the DLL and you have to check that.
- RegWrite,"HKLM",0x1,"WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\<user number>","<user number>","<yourDLL>|DllInstall|I"
- RegWrite,"HKLM",0x1,"WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\<user number>","<user number>","regsvr32.exe /s <yourDLL>"
<user number> has to be defined by you. It determinates the order of executing during boot.
Unfortunatelly (because I do not like Vista) I do not have knowledge if this is also valid for Vista. But I'm rather sure.
Peter
#5 Guest_Msenn_*
Posted 01 February 2008 - 07:17 PM
#6
Posted 01 February 2008 - 07:19 PM
I'm very interested: please, psc, why that value is not RunOnce?RunOnceEx
#7
Posted 01 February 2008 - 07:43 PM
For making snapshots you can use freeware.
It is not good, if when starting only one registers dll's.
#8
Posted 02 February 2008 - 07:13 AM
Ok, here I found an answer...why that value is not RunOnce?
Really I had been some problems with "RunOnce" in a my script, and now I know that alternatively I could use "RunOnceEx"...
If your RunOnce entry needs to be executed after certain event, make sure you write the RunOnce registry key after the event, or if you cannot do so, use RunOnceEx. Otherwise you may experience random failures.
Thanks the same...
#9
Posted 05 February 2008 - 03:15 PM
In pre-Vista based PEs the easiest way is using one of the next statements in your script.
Which statement is necessary depends on the DLL and you have to check that.Usually 'simple DLLs' demand the second way. The first way is for system DLLs like shell32.exe, browseui.dll etc.
- RegWrite,"HKLM",0x1,"WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\<user number>","<user number>","<yourDLL>|DllInstall|I"
- RegWrite,"HKLM",0x1,"WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\<user number>","<user number>","regsvr32.exe /s <yourDLL>"
<user number> has to be defined by you. It determinates the order of executing during boot.
Unfortunatelly (because I do not like Vista) I do not have knowledge if this is also valid for Vista. But I'm rather sure.
Peter
Hi psc,
I have tested this method (second way) in 'Standard Project (XP)' :
RegWrite,"HKLM",0x1,"Tmp_software\Microsoft\Windows\CurrentVersion\RunOnceEx\500","234","net start wimfltr"
... and it works. Small flash of the Command Window when the shell loads.
I was wondering, what happens if <user numbers> are the same as those used in another script?
Regards
#10
Posted 05 February 2008 - 03:26 PM
The latest one (in build) overwrites the previous oneI was wondering, what happens if <user numbers> are the same as those used in another script?
A reason for me to write the scanProject application.
Peter
#11
Posted 05 February 2008 - 03:54 PM
The latest one (in build) overwrites the previous one
Sh....eesh!
Thanks for the warning! I was hoping it might then go alphabetical ... 'n' for 'net start', 'r' for 'regsvr32', etc ...
#12
Posted 05 February 2008 - 07:57 PM
It is if you believe MSDN: "The RunOnceEx registry key sorts the entries and sections alphabetically to force a deterministic order."Sh....eesh! Thanks for the warning! I was hoping it might then go alphabetical ... 'n' for 'net start', 'r' for 'regsvr32', etc ...
Actually, it's reasonably possible also to avoid duplicates and consequential overwrites, even in cases of multiple instances using the same primary numeric sequencer key. For example, some alphabetic schema such as the following scriptname-related approach (multiple 999s) can make duplicates/overwrites quite improbable:
RegWrite,HKLM,0x1,"WB-software\Microsoft\Windows\CurrentVersion\RunOnceEx\999","XnView","||hiderun /w cmd /c#$s#$pSystemDrive#$p\%WorkDir%\%programdir%\xnview_load.cmd" RegWrite,HKLM,0x1,"WB-software\Microsoft\Windows\CurrentVersion\RunOnceEx\999","SSuite","||hiderun /w cmd /c #$s#$pSystemDrive#$p\%WorkDir%\%ProgramDir%\syssuite_load.cmd" RegWrite,HKLM,0x1,"WB-software\Microsoft\Windows\CurrentVersion\RunOnceEx\999","ffSfx","||hiderun /w cmd /c cd#$s#$q#$pSystemDrive#$p\%WorkDir%\FireFox#$q#$s&&#$s#$qfirefox-
#13
Posted 06 February 2008 - 06:24 AM
"The RunOnceEx registry key sorts the entries and sections alphabetically to force a deterministic order."
Thanks Arvy...
I thought I was joking in my previous post!
Cheers ...
#14
Posted 06 February 2008 - 06:54 AM
Heh heh. Well, you might have been. One can never be too sure with Mickeysoft.I thought I was joking in my previous post!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users