Jump to content











Photo
* * * * - 2 votes

MistyPE

winpe10 winpe5 winpe4 winpe3 winpe2 winpe

  • Please log in to reply
383 replies to this topic

#76 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 11 April 2014 - 09:24 AM

@farda
I don't have time to compile scripts for all of the programs listed in your post above - sorry. To compile a script I would need to check whether the program works in all version of MistyPE (WinPE 2.*\3.*\4\5), check for dependencies and also check software licences for each program.

Instead, this is a guide to creating your own MistyPE project script for a program available in x86 and x64 versions (e.g. Notepad2-mod).

We will refer to this program as My.Program. Create the following directory structure (path is relative to WinBuilder.exe) -
\Projects\Cache\Programs\My.Program\x86
\Projects\Cache\Programs\My.Program\x64

Copy the x86 version of My.Program (+dependencies, etc) to \Projects\Cache\Programs\My.Program\x86
Copy the x64 version of My.Program (+dependencies, etc) to \Projects\Cache\Programs\My.Program\x64

Now open notepad, copy and paste the following text and save as \Projects\MistyPE\Programs\My.Program.script -




[main]
Title=My.Program
Description=
Selected=True
Level=3
Author=
Version=1
Date=

[process]
Run,%ScriptFile%,CHECKS
Run,%ScriptFile%,MENU
Run,%ScriptFile%,COMMON
If,%PROGRAMS.IN.WIM%,Equal,NO,Run,%ScriptFile%,NOT.IN.WIM
If,%PROGRAMS.IN.WIM%,Equal,YES,Run,%ScriptFile%,IN.WIM

[CHECKS]
If,Not,ExistFile,"%Programs%\My.Program\%ARCH%\My.Program.exe",Begin
  Message,My.Program is missing - exiting script...,Error,5
  Exit,My.Program is missing - exiting script...,WARN
End

[MENU]
If,Not,ExistFile,"%Cache%\temp\programs.rc.txt",FileCreateBlank,"%Cache%\temp\programs.rc.txt"
If,Not,ExistFile,"%Cache%\temp\programs.cmd.txt",FileCreateBlank,"%Cache%\temp\programs.cmd.txt"
TXTaddLine,"%Cache%\temp\programs.rc.txt",[exec] (My.Program) {#$q%SYSTEMDRIVE%\Programs\My.Program\My.Program.exe#$q},Append
TXTaddLine,"%Cache%\temp\programs.cmd.txt",IF EXIST #$q%~dp0My.Program\My.Program.exe#$q ECHO [exec] (My.Program) {#$q%~dp0My.Program\My.Program.exe#$q} >> #$q%SYSTEMDRIVE%\Programs\bblean\menu.rc#$q,Append

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\My.Program"
DirCopy,"%Programs%\My.Program\%ARCH%\*.*","%PATH%\Programs\My.Program"

[IN.WIM]
Wait,1

[NOT.IN.WIM]
Wait,1
Exit,"My.Program copied to #$q%PATH%\Programs#$q directory - it will not be added to #$qboot.wim#$q",Nowarn

Now to adapt this for Notepad2-mod (here). I'm going to assume here that the executable name is Notepad2.exe for both x86 and x64 versions of the program

Create the following directories -
\Projects\Cache\Programs\Notepad2\x86
\Projects\Cache\Programs\Notepad2\x64

Copy the x86 version of notepad2-mod (+dependencies, etc) to \Projects\Cache\Programs\Notepad2\x86
Copy the x64 version of notepad2-mod (+dependencies, etc) to \Projects\Cache\Programs\Notepad2\x64

Now open notepad, copy and paste the following text and save as \Projects\MistyPE\Programs\Notepad2.script -
 
[main]
Title=Notepad2
Description=
Selected=True
Level=3
Author=
Version=1
Date=

[process]
Run,%ScriptFile%,CHECKS
Run,%ScriptFile%,MENU
Run,%ScriptFile%,COMMON
If,%PROGRAMS.IN.WIM%,Equal,NO,Run,%ScriptFile%,NOT.IN.WIM
If,%PROGRAMS.IN.WIM%,Equal,YES,Run,%ScriptFile%,IN.WIM

[CHECKS]
If,Not,ExistFile,"%Programs%\Notepad2\%ARCH%\Notepad2.exe",Begin
  Message,Notepad2 is missing - exiting script...,Error,5
  Exit,Notepad2 is missing - exiting script...,WARN
End

[MENU]
If,Not,ExistFile,"%Cache%\temp\programs.rc.txt",FileCreateBlank,"%Cache%\temp\programs.rc.txt"
If,Not,ExistFile,"%Cache%\temp\programs.cmd.txt",FileCreateBlank,"%Cache%\temp\programs.cmd.txt"
TXTaddLine,"%Cache%\temp\programs.rc.txt",[exec] (Notepad2) {#$q%SYSTEMDRIVE%\Programs\Notepad2\Notepad2.exe#$q},Append
TXTaddLine,"%Cache%\temp\programs.cmd.txt",IF EXIST #$q%~dp0Notepad2\Notepad2.exe#$q ECHO [exec] (Notepad2) {#$q%~dp0Notepad2\Notepad2.exe#$q} >> #$q%SYSTEMDRIVE%\Programs\bblean\menu.rc#$q,Append

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\Notepad2"
DirCopy,"%Programs%\Notepad2\%ARCH%\*.*","%PATH%\Programs\Notepad2"

[IN.WIM]
Wait,1

[NOT.IN.WIM]
Wait,1
Exit,"Notepad2 copied to #$q%PATH%\Programs#$q directory - it will not be added to #$qboot.wim#$q",Nowarn
As you can see, in this new script all references to My.Program have simply been replaced with Notepad2. Just be sure to check file and folder paths if using this approach. If the executable has a different name to the folder you have put it in you will have to adjust the script accordingly.

This particular script example won't work if the x86 and x64 versions of the program have different file names (see the existing Ghost script for some tips on how to handle this).

I'll complete a similar post for how to create a program script for an x86 only program later (or tomorrow).

Regards,

Misty
  • farda and mikoul like this

#77 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 11 April 2014 - 09:39 AM

This is a guide to creating your own MistyPE project script for a program available in x86 only (e.g. WizTree).

We will refer to this program as My.Program. Create the following directory structure (path is relative to WinBuilder.exe) -
\Projects\Cache\Programs\My.Program

Copy My.Program (+dependencies, etc) to \Projects\Cache\Programs\My.Program

Now open notepad, copy and paste the following text and save as \Projects\MistyPE\Programs\My.Program.script -
 
[main]
Title=My.Program
Description=
Selected=True
Level=3
Author=
Version=1
Date=

[process]
Run,%ScriptFile%,CHECKS
Run,%ScriptFile%,MENU
Run,%ScriptFile%,COMMON
If,%PROGRAMS.IN.WIM%,Equal,NO,Run,%ScriptFile%,NOT.IN.WIM
If,%PROGRAMS.IN.WIM%,Equal,YES,Run,%ScriptFile%,IN.WIM

[CHECKS]
If,%ARCH%,Equal,x64,Begin
  Message,"My.Program is not compatible with x64 builds of WinPE - exiting...",Error,5
  Exit,"My.Program is not compatible with x64 builds of WinPE - exiting..."
End

[MENU]
If,Not,ExistFile,"%Cache%\temp\programs.rc.txt",FileCreateBlank,"%Cache%\temp\programs.rc.txt"
If,Not,ExistFile,"%Cache%\temp\programs.cmd.txt",FileCreateBlank,"%Cache%\temp\programs.cmd.txt"
TXTaddLine,"%Cache%\temp\programs.rc.txt",[exec] (My.Program) {#$q%SYSTEMDRIVE%\Programs\My.Program\My.Program.exe#$q},Append
TXTaddLine,"%Cache%\temp\programs.cmd.txt",IF EXIST #$q%~dp0My.Program\My.Program.exe#$q ECHO [exec] (My.Program) {#$q%~dp0My.Program\My.Program.exe#$q} >> #$q%SYSTEMDRIVE%\Programs\bblean\menu.rc#$q,Append

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\My.Program"
DirCopy,"%Programs%\My.Program\*.*","%PATH%\Programs\My.Program"

[IN.WIM]
Wait,1

[NOT.IN.WIM]
Wait,1
Exit,"My.Program copied to #$q%PATH%\Programs#$q directory - it will not be added to #$qboot.wim#$q",Nowarn
Now to adapt this for WizTree -

Create the following direcory structure -
\Projects\Cache\Programs\WizTree\

Copy WizTree.exe(+dependencies, etc) to \Projects\Cache\Programs\WizTree

Now open notepad, copy and paste the following text and save as \Projects\MistyPE\Programs\WizTree.script -
 
[main]
Title=WizTree
Description=
Selected=True
Level=3
Author=
Version=1
Date=

[process]
Run,%ScriptFile%,CHECKS
Run,%ScriptFile%,MENU
Run,%ScriptFile%,COMMON
If,%PROGRAMS.IN.WIM%,Equal,NO,Run,%ScriptFile%,NOT.IN.WIM
If,%PROGRAMS.IN.WIM%,Equal,YES,Run,%ScriptFile%,IN.WIM

[CHECKS]
If,%ARCH%,Equal,x64,Begin
  Message,"WizTree is not compatible with x64 builds of WinPE - exiting...",Error,5
  Exit,"WizTree is not compatible with x64 builds of WinPE - exiting..."
End

[MENU]
If,Not,ExistFile,"%Cache%\temp\programs.rc.txt",FileCreateBlank,"%Cache%\temp\programs.rc.txt"
If,Not,ExistFile,"%Cache%\temp\programs.cmd.txt",FileCreateBlank,"%Cache%\temp\programs.cmd.txt"
TXTaddLine,"%Cache%\temp\programs.rc.txt",[exec] (WizTree) {#$q%SYSTEMDRIVE%\Programs\WizTree\WizTree.exe#$q},Append
TXTaddLine,"%Cache%\temp\programs.cmd.txt",IF EXIST #$q%~dp0WizTree\WizTree.exe#$q ECHO [exec] (WizTree) {#$q%~dp0WizTree\WizTree.exe#$q} >> #$q%SYSTEMDRIVE%\Programs\bblean\menu.rc#$q,Append

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\WizTree"
DirCopy,"%Programs%\WizTree\*.*","%PATH%\Programs\WizTree"

[IN.WIM]
Wait,1

[NOT.IN.WIM]
Wait,1
Exit,"WizTree copied to #$q%PATH%\Programs#$q directory - it will not be added to #$qboot.wim#$q",Nowarn
As in the previous example (see post directly above this), in this new script all references to My.Program have simply been replaced with WizTree. As with the other example, check file and folder paths - if the executable has a different name to the folder you have put it in you will have to adjust the script accordingly.

Regards,

Misty
  • farda and mikoul like this

#78 Darkman74

Darkman74
  • Members
  • 8 posts

Posted 11 April 2014 - 10:05 AM

Thank you Misty,

 

I give it a Try!



#79 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 11 April 2014 - 11:54 AM

thankyou for helpful replay

i will try that and if i have problem come back here

also what about windows 8.1 installation from MistyPE to hard drive.is it possible?



#80 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 11 April 2014 - 01:25 PM

...also what about windows 8.1 installation from MistyPE to hard drive.is it possible?

@farda
The short answer - Yes it is :loleverybody:
 
The more detailed answer. I'm not familiar with the tool you mentioned in your previous post (which linked to here) - however it's possible to manually install Windows Vista\7\8\8.1 by -
  • Preparing a disk\drive using diskpart
  • Applying the contents of install.wim to the prepared disk
  • Using the bcdboot command to copy the required boot files
You will need a tool capable of extracting/applying the contents of install.wim - I've not tested running wimlib-imagex from MistyPE but this would be my preferred method. Alternatively there's imagex.

Regards,

Misty
  • farda likes this

#81 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15387 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 April 2014 - 02:32 PM

 
I'm not familiar with the tool you mentioned in your previous post (which linked to here) - however it's possible to manually install Windows Vista\7\8\8.1 by -

  • Preparing a disk\drive using diskpart
  • Applying the contents of install.wim to the prepared disk
  • Using the bcdboot command to copy the required boot files

...

Just for the record the nice tool by JFX:

http://www.msfn.org/...v33-v34-beta-1/

 

Features:

- Install Windows 2k/XP/2003/2008/2012/Vista/7/8.x x86/x64
- Practically runs even on the most minimalistic WinPE
- Choose able drive letter for the new Windows installation
- Install Windows also if nlite/vlite has remove winnt32.exe/setup.exe
- Integrate Drivers: normal PNP and Textmode Drivers also
- patch uxtheme to allow unsigned Themes
- Some tweaks
- Support "Windows to Go" for Windows 7 and later installs

 

 

allows to install *almost* anything, and however it is derived from this "basic tool":

 

http://reboot.pro/to...external-drive/

 

:duff:

Wonko



#82 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 12 April 2014 - 12:16 PM

hi

i build WinPE.iso from windows 8.1 Enterprise update1 iso.but it dont boot.

tested in virtual box,real PC and QEMU

in virtual box,real PC it stay on first screenshot

 

ba11de6d3ef01bb8a2df64a347b63c5b.png

49f6685e68490297d3b8e8b655c791cd.png
 

 



#83 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 12 April 2014 - 12:27 PM

Hi farda,

I have not tested this source at all - hadn't even realised it had been released until earlier today.

In regards to qemu - I noticed when carrying out some tests on WinFE a while ago that builds based on WinPE 4.0 and 5.0 did not work. After testing a number of virtual solutions I ended up using VMWarePlayer - see here for the post about my tests.

I have not tested any of the builds on a UEFI based system as I don't have any compatible hardware - not sure if this might be an issue.

I'll check out the new Windows 8.1 update when I get the chance to test compatibility.

Regards,

Misty
  • farda likes this

#84 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 12 April 2014 - 12:40 PM

also my PC haven't UEFI

 

 

edit:

also based on your guide i created script and with files

Download


Edited by farda, 12 April 2014 - 01:39 PM.


#85 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 12 April 2014 - 03:39 PM

Project updated -
  • File dependencies (to be extracted from install.wim or copied from the host Operating System) are handled in one(hidden) script - Core\required.files.script. This will make it simpler to implement any future file dependencies.
  • Added a script to copy files and folders from a local directory - allowing the easy addition of third party files. A menu entry will open the directory these files were copied to.
  • Added Tools\Create USB script - it's now possible to create a MistyPE bootable UFD during the build process. Use with caution - see documentation for more details. Tested with Windows 7 (SP1) and Windows 8.1.
  • Added ADK For Win 8 (and 8.1) scripts. Refer to documents. NOTE - this has only been tested using Windows 7 (SP1) and Windows 8.1.
  • Wallpaper support (.jpg) added for all builds - this feature was not previously working with WinPE 4/5. See Programs\Wallpaper script.
  • WinFE\WinFE script now contains options to use different combinations of SANPolicy and NoAutoMount settings.
  • Wimlib-ImageX updated to version 1.6.2
  • Documentation updated - added section on using the ADK For Win 8.1.
Regards,

Misty
  • farda likes this

#86 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 12 April 2014 - 03:49 PM

@farda
I've not had the chance to look through your scripts yet as I've been working on a major update to the project.

I noticed that some of the executable you uploaded do not run in a 64-bit WinPE. This includes -
  • AntRenamer
  • AnyBurn
  • QuickEncryption
  • SearchForDuplicates
  • WizTree
I'm assuming they are actually 32-bit executables. They will function in a full 64-bit Windows OS due to the WOW64 subsystem, but not a 64-bit WinPE. Check out my earlier post for the instructions on creating a script for a program available in x86 only.

I'll have a closer look soon - I'm knackered from staring at WinBuilder code all day!

Regards,

Misty
  • farda likes this

#87 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 12 April 2014 - 08:47 PM

@misty

ok,i create this for AnyBurn based on second guide.

but i run WinBuilder.exe then i go to  AnyBurn and click play

now i go to MistyPE.Project.Output and other subfolder and i see just AnyBurn.exe is copied

not any other file in  AnyBurn folder



#88 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 12 April 2014 - 08:56 PM

@farda
 
Sorry! :white_flag:

Please amend the [COMMON] section of the script example from -
[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\My.Program"
FileCopy,"%Programs%\My.Program\My.Program.exe","%PATH%\Programs\My.Program"
to -
 
[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\My.Program"
DirCopy,"%Programs%\My.Program\*.*","%PATH%\Programs\My.Program"
Note that the Last line in this section is edited. Please blame my mistake on far too many hours staring at code!!! :chair:

Misty

P.s. Thanks for testing as it's highlighted the mistake - I'll amend the post too!
  • farda and mikoul like this

#89 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 12 April 2014 - 09:16 PM

thank you for your support and help

tested and working

no blaming you ,i am grateful for your help

also same happen to snapshot i copy mylicense to SnapShot folder on the output license don't copied.

and i tested them in Misty pe from windows 7 image and working :clap: :good:

just i must found alternative for QuickEncryption ,it working but after Encryption, try to launch output folder

thats need explorer.exe so give me error.

 

and just for info  when i tested in windows 7 pe it first load windows file  then some blinking dash like first screenshot on the above

after some blinking go to boot process

in windows 8.1 update it should load windows file like windows7 pe but don't doing this.

 

Download Link Updated


Edited by farda, 12 April 2014 - 10:12 PM.


#90 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 14 April 2014 - 10:23 PM

Project updated -
  • Fixed problem with menu entries for Forensic applications - they were not being parsed in some circumstances.
  • KeyboardLayout batch file updated.
Regards,

Misty

#91 Darkman74

Darkman74
  • Members
  • 8 posts

Posted 15 April 2014 - 11:04 AM

Hail the King!!! 

 

 

THANK YOU MISTY!! :hyper:

 

Exaktly what i need!



#92 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 15 April 2014 - 02:08 PM

@misty

i want add below registry to my notpad2 script how convert them,

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\OpenWithList\notepad2.exe]
@=""

[HKEY_CLASSES_ROOT\Applications\notepad2.exe]
@=hex:
"AppUserModelID"="Notepad2"

[HKEY_CLASSES_ROOT\Applications\notepad2.exe\shell]
@=hex:

[HKEY_CLASSES_ROOT\Applications\notepad2.exe\shell\open]
@=hex:

[HKEY_CLASSES_ROOT\Applications\notepad2.exe\shell\open\command]
@="\"C:\\Program Files\\Notepad2\\Notepad2.exe\" %1"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="\"C:\\Program Files\\Notepad2\\Notepad2.exe\" /z"




Edited by farda, 15 April 2014 - 02:08 PM.


#93 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 15 April 2014 - 04:39 PM

@farda

Registry settings are applied in two sections of the program scripts at the moment. Using the Drive Snapshot script as an example -

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\SnapShot"
If,%ARCH%,Equal,x86,FileCopy,"%Programs%\SnapShot\snapshot.exe","%PATH%\Programs\SnapShot"
If,%ARCH%,Equal,x64,FileCopy,"%Programs%\SnapShot\snapshot64.exe","%PATH%\Programs\SnapShot"
If,Not,ExistFile,"%PATH%\Programs\registry.entries.cmd",Begin
  FileCreateBlank,"%PATH%\Programs\registry.entries.cmd"
  TXTaddLine,"%PATH%\Programs\registry.entries.cmd",@Echo off,Append
  TXTaddLine,"%PATH%\Programs\registry.entries.cmd",,Append
End
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",::===========SNAPSHOT========,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",::for file associations,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",IF EXIST #$q%~dp0Snapshot\Snapshot.exe#$q (,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",ECHO.,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",ECHO Snapshot Registry Entries,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\.sna#$q /ve /t REG_SZ /d #$qSnapshot#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot#$q /ve /t REG_SZ /d #$qSnapshot Mount#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot\DefaultIcon#$q /ve /t REG_SZ /d #$q%~dp0Snapshot\Snapshot.exe#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot\shell\open\command#$q /ve /t REG_SZ /d #$q\#$q%~dp0Snapshot\Snapshot.exe\#$q \#$q%%1\#$q#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",),Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",IF EXIST #$q%~dp0Snapshot\Snapshot64.exe#$q (,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",ECHO.,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",ECHO Snapshot Registry Entries,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\.sna#$q /ve /t REG_SZ /d #$qSnapshot#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot#$q /ve /t REG_SZ /d #$qSnapshot Mount#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot\DefaultIcon#$q /ve /t REG_SZ /d #$q%~dp0Snapshot\Snapshot64.exe#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",reg.exe add #$qHKLM\SOFTWARE\Classes\Snapshot\shell\open\command#$q /ve /t REG_SZ /d #$q\#$q%~dp0Snapshot\Snapshot64.exe\#$q \#$q%%1\#$q#$q /f,Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",),Append
TXTaddLine,"%PATH%\Programs\registry.entries.cmd",,Append

[IN.WIM]
Echo,"Mounting registry hives..."
If,Not,ExistRegSection,HKLM,_WinPE_SOFTWARE,RegHiveLoad,_WinPE_SOFTWARE,"%Target_config%\software"
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\.sna,,Snapshot
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\Snapshot,,Snapshot Mount
If,%ARCH%,Equal,x86,Begin
  RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Snapshot\DefaultIcon,,%SYSTEMDRIVE%\Programs\Snapshot\Snapshot.exe
  RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Snapshot\shell\open\command,,%SYSTEMDRIVE%\Programs\Snapshot\Snapshot.exe #$q%1#$q
End
If,%ARCH%,Equal,x64,Begin
  RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Snapshot\DefaultIcon,,%SYSTEMDRIVE%\Programs\Snapshot\Snapshot64.exe
  RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Snapshot\shell\open\command,,%SYSTEMDRIVE%\Programs\Snapshot\Snapshot64.exe #$q%1#$q
End
Echo,"Unmounting registry hives..."
RegHiveUnload,_WinPE_SOFTWARE
Wait,1
The entries in the [common] section of the script write a number of lines to a batch file - this is only executed when option 8] Programs in boot.wim is set as NO (in the main project script options).

The entries in the [IN.WIM] section are applied to the WinPE registry hives. Just a quick word of warning - OpenWithList is not working in WinPE 4.0/5.0 - it works fine in WinPE 3.* though.

A script you could use as an example for adding support for OpenWithList is the TinyHexer script -
[IN.WIM]
Echo,"Mounting registry hives..."
If,Not,ExistRegSection,HKLM,_WinPE_SOFTWARE,RegHiveLoad,_WinPE_SOFTWARE,"%Target_config%\software"
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\shell\tinyhexer,,Open with TinyHexer
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\*\shell\tinyhexer\command,,%Systemdrive%\Programs\TinyHexer\MPTH_SMALL.EXE #$q%1#$q
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\OpenWithList\MPTH_SMALL.EXE,,TinyHexer
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Applications\MPTH_SMALL.EXE\shell\open\command,,%Systemdrive%\Programs\TinyHexer\MPTH_SMALL.EXE #$q%1#$q
Echo,"Unmounting registry hives..."
RegHiveUnload,_WinPE_SOFTWARE
Wait,1
Hope this helps for now!

Good luck (again)! If you have any questions I'll be happy to try to answer them.

Regards,

Misty
  • farda likes this

#94 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 15 April 2014 - 08:52 PM

thank you very much for your answer.i try them

just with what i must replace "C:\\Program Files" ? is this %Systemdrive%\Programs\notepad2

and maybe easy way to create batch file to import registy when windows pe boot?

reg add "HKCR\*\OpenWithList\notepad2.exe" /f /ve /t REG_SZ /d ""
reg add "HKCR\Applications\notepad2.exe" /f /v "AppUserModelID" /t REG_SZ /d "Notepad2"
reg add "HKCR\Applications\notepad2.exe\shell\open\command" /f /ve /t REG_SZ /d "\"C:\Program Files\Notepad2\Notepad2.exe\" %%1"
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f /v "Debugger" /t REG_SZ /d "\"C:\Program Files\Notepad2\Notepad2.exe\" /z"

also i want add this file srvsvc.dll to my pe.this needed for PENetCfg

how do that



#95 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 15 April 2014 - 09:23 PM

@farda
I've had a look at the registry file you posted. A value of @=hex: results in a registy key with the following entries (as displayed in regedit) -
  • Name - (Default)
  • Type - REG_BINARY
  • Data - (zero-length binary value)
I'm no expert on the Windows registry, however this doesn't seem like a standard type of entry. Most (Default) entries are of Type REG_SZ.

Assuming that when you stated....

i want add below registry to my notpad2 script how convert them...

...you meant that you wanted to add Notepad2.exe to the OpenWithList (and also in the right-click context menu) in the MistyPE project (with path = %Systemdrive%\Programs\Notepad2\Notepad2.exe) - try adding something similar to the following to your program script (in the [IN.WIM] section) -
Echo,"Mounting registry hives..."
If,Not,ExistRegSection,HKLM,_WinPE_SOFTWARE,RegHiveLoad,_WinPE_SOFTWARE,"%Target_config%\software"
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\shell\Notepad2,,Open with Notepad2
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\*\shell\Notepad2\command,,%Systemdrive%\Programs\Notepad2\Notepad2.exe #$q%1#$q
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\OpenWithList\Notepad2.exe,,Notepad2
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Applications\Notepad2.exe\shell\open\command,,%Systemdrive%\Programs\Notepad2\Notepad2.exe #$q%1#$q
Echo,"Unmounting registry hives..."
RegHiveUnload,_WinPE_SOFTWARE
Wait,1
The Debugger code (I have no idea if this will work in WinPE - it's based on your reg file requirements) would be either -
RegWrite,HKLM,0x2,"_WinPE_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe",Debugger,#$q%Systemdrive%\Programs\Notepad2\Notepad2.exe#$q /z
or
RegWrite,HKLM,0x1,"_WinPE_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe",Debugger,X:\Programs\Notepad2\Notepad2.exe /z
Also based on your .reg file requirements -
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\Applications\Notepad2.exe,AppUserModelID,Notepad2
Putting this all together -
Echo,"Mounting registry hives..."
If,Not,ExistRegSection,HKLM,_WinPE_SOFTWARE,RegHiveLoad,_WinPE_SOFTWARE,"%Target_config%\software"
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\shell\Notepad2,,Open with Notepad2
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\*\shell\Notepad2\command,,%Systemdrive%\Programs\Notepad2\Notepad2.exe #$q%1#$q
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\*\OpenWithList\Notepad2.exe,,Notepad2
RegWrite,HKLM,0x1,_WinPE_SOFTWARE\Classes\Applications\Notepad2.exe,AppUserModelID,Notepad2
RegWrite,HKLM,0x2,_WinPE_SOFTWARE\Classes\Applications\Notepad2.exe\shell\open\command,,%Systemdrive%\Programs\Notepad2\Notepad2.exe #$q%1#$q
RegWrite,HKLM,0x1,"_WinPE_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe",Debugger,X:\Programs\Notepad2\Notepad2.exe /z
Echo,"Unmounting registry hives..."
RegHiveUnload,_WinPE_SOFTWARE
Wait,1
I'll get back to you about the srvsvc.dll dependency.

Regards,

Misty

#96 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 15 April 2014 - 09:41 PM

@farda
There's a hidden (at least it's hidden from the WinBuilder GUI) file - \Projects\MistyPE\Core\required.files.script. Open this file in notepad and add the following (in the existing sections) -


[Files.From.Install.WIM]
ShellExecute,Hide,"%Tools%\wimlib\wimlib-imagex.exe","extract #$q%Install.wim%#$q 1 /windows/system32/srvsvc.dll --dest-dir=#$q%Cache%\source\%ARCH%#$q"
[Files.From.Host.OS]
If,ExistFile,"%WindowsSystemDir%\srvsvc.dll",FileCopy,"%WindowsSystemDir%\srvsvc.dll","%Cache%\source\%ARCH%"
This will add srvsvc.dll to the cached files. You will then need to add it to the relevant program script. I would advise against copying it to the system32 directory. Most programs will function if dependencies are added to the same directory as the .exe file. Try adding the following to the [CHECKS] section (in your program script) -
 
If,Not,ExistFile,"%Cache%\source\%ARCH%\srvsvc.dll",Begin
  Message,A file dependancy for PENetCfg is missing. Exiting program script - refer to the log,Error,5
  Exit,File dependancy (srvsvc.dll) for PENetCfg is missing.
End
And this to the [COMMON] section -
FileCopy,"%Cache%\source\%ARCH%\srvsvc.dll","%PATH%\Programs\PENetCfg"
Regards,

Misty

P.s. I've not tested the above code - it's based on existing entries in the MistyPE project.
  • farda likes this

#97 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 15 April 2014 - 10:48 PM

thank you for registry script and dependency file
my registry add notepad2 to open with window
you add "Open with Notepad2" to right click so every none text based file easy can open.
Image File Execution cause open text in notepad2 instead of  windows notepad

dll file was not work if in the same folder so i changed to so give no error
also is this file shareing service is aviable in MistyPE?it seems need too
say unable to start file sharing service.

FileCopy,"%Cache%\source\%ARCH%\srvsvc.dll","%PATH%\Windows\System32"


thank you  for helping me



#98 misty

misty

    Gold Member

  • Developer
  • 1035 posts
  •  
    United Kingdom

Posted 16 April 2014 - 07:04 PM

...also is this file shareing service is aviable in MistyPE?it seems need too
say unable to start file sharing service.



FileCopy,"%Cache%\source\%ARCH%\srvsvc.dll","%PATH%\Windows\System32"
@farda
Unfortunately the file sharing service is not supported in MistyPE. Reminder from the main project page "This is a minimalist 32 or 64-bit WinPE/WinFE...".

Do you actually need file sharing in WinPE? It is possible to connect to a network share on another PC - just not possible to create a share on the PC running MistyPE.

Regards,

Misty
  • farda likes this

#99 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 16 April 2014 - 08:45 PM

i can ignore this tool its not very necessary

thank you



#100 farda

farda

    Newbie

  • Members
  • 23 posts
  •  
    Iraq

Posted 19 April 2014 - 01:57 PM

hi misty

remove this registry if possible,this registry remove context menu Send To ,Pin to Start Menu,Pin to task bar,share with.,include inlibrary

Windows Registry Editor Version 5.00
; remove include inlibrary context menu
[HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\ShellEx\ContextMenuHandlers\Library Location]
;remove share with context menu
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Sharing]

[HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Sharing]

[HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Sharing]

[HKEY_CLASSES_ROOT\Directory\shellex\CopyHookHandlers\Sharing]

[HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\Sharing]

[HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\Sharing]

[HKEY_CLASSES_ROOT\Drive\shellex\PropertySheetHandlers\Sharing]

[HKEY_CLASSES_ROOT\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing]

[HKEY_CLASSES_ROOT\UserLibraryFolder\shellex\ContextMenuHandlers\Sharing]

;Remove Pin to task bar
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\{90AA3A4E-1CBA-4233-B8BB-535773D48449}]
@="Taskband Pin"

; Remove Send To from Context Menu
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo]

[HKEY_CLASSES_ROOT\UserLibraryFolder\shellex\ContextMenuHandlers\SendTo]

;Remove Pin to Start Menu
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}]
@="Start Menu Pin"

Edited by farda, 19 April 2014 - 01:59 PM.






Also tagged with one or more of these keywords: winpe10, winpe5, winpe4, winpe3, winpe2, winpe

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users