Jump to content











Photo

Taskbar Tutorial (Rough Draft)


  • Please log in to reply
3 replies to this topic

#1 RoyM

RoyM

    Frequent Member

  • .script developer
  • 420 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 12 August 2010 - 04:32 AM

(How To) Functional Taskbar for nativeEX_Win7,
Works for other PE3's also
(How To) Register clid.reg at build time, not boot time


Open nativeEX_Win7 in Virtual Machine
Right Click Shortcuts and Pin them to taskbar
##### FOR PROGRAMS ON CDDRIVE ########
Programs on %CDDrive% won't display (PIN TO TASKBAR)
Copy %CDDrive%\Programs\%ProgramFolder%\%ProgramEXE% to writeable location (ie) X:
Create new shortcut for %ProgramEXE%
Extract Icon of %ProgramEXE% and copy to sys32
(I use iconsext.exe)
GOTO X:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
These are the icons you just pinned to taskbar,
check them for correctness,
(ie) .exe location, sys32\.icon and start in

Edit shortcut\properties\Change Icon;
point it towards Icon you just placed in sys32

Edit shortcut\properties\target;
Change target to point to original
%CDDrive%\Programs\%ProgramFolder%\%ProgramEXE%

Edit shortcut\properties\start in;
Change start in to point to original
%CDDrive%\Programs\%ProgramFolder%

When done pinning, Rearrange icons to your liking

EXPORT [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband] to taskbar.reg
CODE; REG EXPORT HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband x:\taskbar.reg
move taskbar.reg from Virtual machine to Host machine
######## NOTES #############

I don't use win7peldr to create my shortcuts,
I make my shortcuts in VM, 7zip them and include them in scripts
as demonstrated below. Additionaly I extract the icon from
%ProgramEXE% and place it in sys32 via script
The reason for icon in sys32 is that icons won't display correctly until %CDDrive% is defined and shortcut can find .ico
This ensures your shortcuts always display correctly

If you plan to runfromram and runfromcd you will need shortcuts for both,
Easiest way to do this is to run your build with programs running from CD in VM.

Right click %CDDrive%\Programs\%ProgramFolder%\%ProgramEXE%
and create shortcut, shortcut will be placed on desktop

Now copy %CDDrive%\Programs\%ProgramFolder%
to X:\Program Files

Navigate to X:\Program Files\%ProgramFolder%
Right click %ProgramEXE% and create shortcut,
shortcut will remain in %ProgramFolder%

Now you can select Properties and edit
shortcut properties on both shortcuts side by side.

When done 7zip up the run from cd shortcut to
%ProgramTitle%.7z
and the run from ram shortcuts to
%ProgramTitle%R.7z

move 7zipped shortcuts from Virtual machine to Host machine
and attach to appropriate scripts they come from.

** Here is how I select the appropriate shortcut to place in \Taskband folder **
** Using this method results in faster boot and shortcuts that always display correctly.
** Notice the R in Run from ram shortcuts ** %ProgramTitle%R.7z
##################################################################
// RUN FROM RAM SHORTCUTS
If,%pCheckBox1%,Equal,True,Begin
SET,"%DestDir%","%TargetDir%\Program#$sFiles\%ProgramFolder%"
SET,"%LinkDir%","%SystemDrive%\Program#$sFiles\%ProgramFolder%"
If,%pCheckBox2%,Equal,True,Unpack,link,"%ProgramTitle%R.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs","%pTextBox1%"
If,%pCheckBox3%,Equal,True,Unpack,link,"%ProgramTitle%R.7z",True,"%Target_Sys%\config\systemprofile","Desktop"
If,%pCheckBox4%,Equal,True,Unpack,Link,"%ProgramTitle%R.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned","TaskBar"
If,%pCheckBox5%,Equal,True,Unpack,link,"%ProgramTitle%R.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Windows","SendTo"
End
// RUN FROM CDDRIVE SHORTCUTS
If,%pCheckBox1%,Equal,False,Begin
SET,"%DestDir%","%TargetDir%\Programs\%ProgramFolder%"
SET,"%LinkDir%","%CDDrive%\Programs\%ProgramFolder%"
If,%pCheckBox2%,Equal,True,Unpack,link,"%ProgramTitle%.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs","%pTextBox1%"
If,%pCheckBox3%,Equal,True,Unpack,link,"%ProgramTitle%.7z",True,"%Target_Sys%\config\systemprofile","Desktop"
If,%pCheckBox4%,Equal,True,Unpack,Link,"%ProgramTitle%.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned","TaskBar"
If,%pCheckBox5%,Equal,True,Unpack,link,"%ProgramTitle%.7z",True,"%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Windows","SendTo"
End

*** Heres how I unpack my icons; ***
ExtractAllFiles,"%ScriptFile%","sys32","%Target_Sys%"
##################################################################

When building Your PE;
Add shortcuts you pinned earlier by extracting them to;
%Target_Sys%\config\systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
either one at a time via script or all at once, either works.
Also Place taskbar.reg and .icons for taskbar shortcuts in sys32 via script, see examples above

Run taskbar.reg at BUILD time, either by manualy appending to clid.reg or adding next line to Shell & Config.script
before explorer.exe runs

If,"%Shell%",Equal,"Explorer",If,%pCheckBox5%,Equal,False,TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","regedit /s taskbar.reg","Append"


*** YOU NOW HAVE A WORKING TASKBAR ***

####### REGISTERING CLID.REG AT BUILD TIME ############
I also would like some feedback on this tweak;
it works fine in my builds, but I need to see if it works for everyone

Extract clid.reg from Shell & Config.script
*** Make a backup of clid.reg before you start ***
Open clid.reg in editor
Replace HKEY_CLASSES_ROOT w HKEY_LOCAL_MACHINE\WB-Hive\Classes (REPLACE ALL) && SAVE FILE
Import saved clid.reg back into
Shell & Config.script\Attachments\Folder
(SAME PLACE IT WAS EXTRACTED FROM)

*** PLACE NEXT LINE IN Shell & Config.script\ [Process] Section
Run,%ScriptFile%,REGISTER CLID


*** PLACE THIS CODE FURTHER DOWN THE SCRIPT, NOT IN [Process] Section
[REGISTER CLID]
ExtractFile,%ScriptFile%,"Folder","clid.reg",%GlobalTemp%
Hive_Load,HKU
ShellExecute,"open","regedit.exe","/s #$q%GlobalTemp%\clid.reg#$q"
FileDelete,"%GlobalTemp%\clid.reg"
Hive_UnLoad,HKU
##

In Shell & Config.script comment out;
"I think this is the correct line", you want to comment the code that runs regedit to register clid.reg
//TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","#$qregedit#$qs/s#$s/Wait#$sclid.reg#$q","Append"


THIS WILL REGISTER CLID.REG AT BUILD TIME,
RATHER THAN AT BOOT TIME
DOING THIS WILL ENSURE THAT WHEN YOUR
SCRIPTS WRITE TO THE REGISTRY
THEY WON'T BE OVERWRITTEN BY CLID.REG

*** MAJOR PROBLEMS ARISE WHEN USED WITH MMC.SCRIPT ***

APPARENTLY WHAT IS HAPPENING IS THERE ARE BROKEN
REGISTRY ENTRIES IN MMC.SCRIPT\REG.7Z\CLASSES.REG
WHICH WOULD FAIL AT BOOT TIME IN VM

PRIOR TO THIS TWEAK, MMC.SCRIPT WOULD REGISTER
CLASSES.REG AT BUILD TIME
THEN CLID.REG WOULD THEN OVERWRITE THE ENTRIES AT BOOT TIME
THUS PREVENTING BROKEN REGISTRY ENTRIES FROM LOADING

(FIX=)
HERE'S HOW I TESTED;
DELETE EVERYTHING IN %TargetDir%
MAKEDIR %TargetDir%\windows\system32\config\
IN %TargetDir%\windows\system32\config\ CREATE EMPTY TXT FILE NAMED SOFTWARE

OPEN %TargetDir%\windows\system32\config\SOFTWARE
IN REGISTRY LOADER PE
REGISTRY ENTRY _C_SOFTWARE WILL EXIST BUT IT'S EMPTY

COPY MMC.SCRIPT\REG.7Z\CLASSES.REG AND SHELL&CONFIG.SCRIPT\FOLDER\CLID.REG TO %TargetDir%

OPEN CLASSES.REG IN TEXT EDITOR; REPLACE WB-software with
wb-hive (REPLACE ALL AND SAVE)

OPEN CLID.REG IN TEXT EDITOR;
REPLACE HKEY_CLASSES_ROOT with
HKEY_LOCAL_MACHINE\wb-hive\Classes (REPLACE ALL)

REPLACE [ with [- (REPLACE ALL)
THIS STEP NOT NECESSARY; REPLACE = with =- (REPLACE ALL)
DELETE LINE 3 [-HKEY_LOCAL_MACHINE\wb-hive\Classes]
DELETE LINE 8916 [-HKEY_LOCAL_MACHINE\wb-hive\Classes\CLSID] (SAVE FILE)

IN CODEBOX;
Hive_Load,HKU
ShellExecute,"open","regedit.exe","/s #$q%TargetDir%\classes.reg#$q"
Hive_UnLoad,HKU
# RUN CODEBOX

VERIFY ENTRIES IN REGISTRY;
OPEN REGISTRY LOADER PE,(SOFTWARE) REGISTRY ENTRY _C_SOFTWARE
WILL EXIST WITH ALL REGISTRY ENTRIES FROM CLASSES.REG

OR USE RegEditWB.script AND ENTRIES WILL BE UNDER WB-Software

IF REGISTRY ENTRIES ARE THERE, CLOSE REGISTRY LOADER PE AND CONTINUE TO NEXT STEP

IN CODEBOX;
Hive_Load,HKU
ShellExecute,"open","regedit.exe","/s #$q%TargetDir%\clid.reg#$q"
Hive_UnLoad,HKU
# RUN CODEBOX

OPEN REGISTRY LOADER PE,(SOFTWARE)
EXPORT HKEY_LOCAL_MACHINE\_C_SOFTWARE\Classes\CLSID to CLASSES.REG
OPEN EXPORTED CLASSES.REG IN TEXT EDITOR; REPLACE _C_SOFTWARE with WB-SOFTWARE (REPLACE ALL && SAVE FILE)
REPLACE MMC.SCRIPT\REG.7Z\CLASSES.REG with
NEW CLASSES.REG YOU JUST EXPORTED

WHAT YOU SHOULD BE LEFT WITH ARE REGISTRY ENTRIES FROM CLASSES.REG WHICH ARE NOT DUPLICATED IN CLID.REG
THUS PREVENTING CLASSES.REG FROM OVERWRITING CLID.REG
WITH BROKEN REGISTRY ENTRIES

*** IF USING XCHM.SCRIPT ***
*** CHANGE XCHM.SCRIPT\Files\hta.7z ***
*** OR EXPLORER WON'T OPEN IN SAME WINDOW ***
LINE 6304
[HKEY_LOCAL_MACHINE\Tmp_software\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]
@="{A4A1A128-768F-41E0-BF75-E4FDDD701CBA}"
; [HKEY_LOCAL_MACHINE\Tmp_software\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]
; @="{C90250F3-4D7D-4991-9B69-A5C5BC1C2AE6}"
; [HKEY_LOCAL_MACHINE\Tmp_software\Classes\Interface\{3CA46D75-46C3-453D-953C-03A2570C1EB6}\NumMethods]
; @="8"


LINE 11073
; [HKEY_LOCAL_MACHINE\Tmp_software\Classes\htmlfile\shell\open\command]
; @="\"x:\\Program Files\\Internet Explorer\\iexplore.exe\" -nohome"


If using Z-BaseBuildEx.script you will have to active and rebuild for
tweak to be included in build.

#2 Holmes.Sherlock

Holmes.Sherlock

    Gold Member

  • Team Reboot
  • 1444 posts
  • Location:Santa Barbara, California
  •  
    United States

Posted 16 August 2010 - 01:04 AM

Thanx

#3 peetx

peetx

    Newbie

  • Members
  • 10 posts

Posted 16 August 2010 - 08:13 PM

flabbergasting ... wow ... ok ... cool ... but weird long way. Thanks a million for figuering this out, if someone now could make a script from this to either "operate" another scripts source code in the right way - or a script which will go through your target folders and works out the correct patching of all found in those?

well done by now, thanks

#4 RoyM

RoyM

    Frequent Member

  • .script developer
  • 420 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 16 August 2010 - 09:58 PM

Yes Peetx, it is rather the long way to go about it, but it's rather difficult to write a script which will export the registry settings and icons from a VM back into a Winbuilder script. Now, with that said, I have only witnessed one script which will add to the taskbar at build time correctly, "IE8.script", Hopefully the Winbuilder community now armed with this new info can pull together and find a definitive fix so we all can have a fully functional taskbar.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users