Jump to content











Photo
- - - - -

PE 3.x Packages Installation Script


  • Please log in to reply
12 replies to this topic

#1 FerrariGuy

FerrariGuy

    Member

  • Members
  • 50 posts
  • Location:South Carolina
  •  
    United States

Posted 24 August 2011 - 03:58 PM

I occasionally have need to add WAIK packages to my WinPE7_SE build (HTA support, MDAC support, etc). I heavily modifiied a script from Mustang and Khauyeung in order to more efficently acomplish what I wanted to do.

I'm posting the code here currently rather than as a download, because the script is limited to build systems that can use DISM.exe without erroring (which can happen when an earlier version of WinPE7_SE has installed wimfltr.inf on Win 7). Note that the x86 DISM.exe can service an x64 image/packages. Hopefully some will find it useful.


[Main]

Title=1 - Packages Installer

Author=by Paul Larini's (mustang) | modified and developed by khauyeung | Modified by FerrariGuy

Level=1

Version=014

Description=Install packages %BootSrc% which was mounted R/W (by DISM) during the previous step. !!DISM of WAIK 3.x is required.!!#$XPEIMG InF Installer for 32/64 Win 7

Locked=False

Contact=

Date=08.24.2011

Selected=True

Interface=Interface

Mandatory=False

Download_Level=1

NoWarning=False

[Variables]

%Switch%

[Interface]

pTextLabel1="You must have the WAIK and DISM installed for this script to work.",1,1,10,7,533,18,8,Bold

pTextLabel5="Specify the paths for up to 6 PACKAGES (.cab or .msu) like the example below:",1,1,6,65,424,18,8,Normal

pCheckBox1="Pause after each DRIVER/PACKAGE is installed to check status. (Type 'EXIT' to continue)",1,3,15,275,533,18,False

pFileBox1=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\WINPE-HTA.CAB,1,13,3,86,429,30,file

pFileBox2=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\EN-US\WINPE-HTA_EN-US.CAB,1,13,3,113,429,30,file

pFileBox3=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\WINPE-WMI.CAB,1,13,3,141,429,30,file

pFileBox4=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\EN-US\WINPE-WMI_EN-US.CAB,1,13,3,169,429,30,file

pFileBox5=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\WINPE-MDAC.CAB,1,13,3,202,429,30,file

pFileBox6=D:\WIAK3.1\Tools\x86\WINPE_FPS_SP1\EN-US\WINPE-MDAC_EN-US.CAB,1,13,3,232,429,30,file

pFileBox7=D:\WIAK3.1\Tools\Servicing\,1,13,150,32,429,30,dir

pButton1=Save,1,8,482,252,60,25,Interface,_Interface_,False

pCheckBox2="Use DISM  of WAIK3.x at:",1,3,6,37,145,18,True

[Process]

Echo,"Processing .. Adding Selected Packages ..."

If,"%pCheckBox1%",Equal,False,Set,%Switch%,"/c#$s"

If,"%pCheckBox1%",Equal,True,Set,%Switch%,"/k#$s"

If,"%pCheckBox2%",Equal,true,Run,%ScriptFile%,dism_inf

[dism_inf]

If,NotExistFile,"%pFileBox7%\dism.exe",Run,%ScriptFile%,WAIKNotFound

Echo,"Processing Package 1 ..."

If,"%pFileBox1%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox1%"

Echo,"Processing Package 2 ..."

If,"%pFileBox2%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox2%"

Echo,"Processing Package 3 ..."

If,"%pFileBox3%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox3%"

Echo,"Processing Package 4 ..."

If,"%pFileBox4%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox4%"

Echo,"Processing Package 5 ..."

If,"%pFileBox5%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox5%"

Echo,"Processing Package 6 ..."

If,"%pFileBox6%",NotEqual,"",ShellExecute,Open,"cmd.exe","%Switch%#$q%pFileBox7%dism.exe#$q /image:%BootSrc% /Add-Package /PackagePath:%pFileBox6%"

[WAIKNotFound]

Message,"Error: Unable to locate DISM.EXE#$x#$xReason: Invalid path to the WAIK or the WAIK is not installed.#$x#$xFix: Enter the correct path or install the WAIK.#$x#$xScript aborted.",Error

Exit,"Exiting..."

 


Posted Image
Uploaded with ImageShack.us
  • Nuno Brito likes this

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10424 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 24 August 2011 - 05:08 PM

Hi FerrariGuy, thank you for sharing.

In my opinion, this script is ok to be posted on the system scripts. Just ensure you explain clearly where and how it should be used.

While app scripts are expected to be generic enough to work across different projects/platforms, system scripts are expected to be specific to a given type of projects and your work fits that category.

On this forum section it will quickly get hidden among other posts that will be appearing and then it will be difficult to find it again.

Again, thank you for the script. I find it very useful to automate this task.

:cheers:

#3 FerrariGuy

FerrariGuy

    Member

  • Members
  • 50 posts
  • Location:South Carolina
  •  
    United States

Posted 24 August 2011 - 06:01 PM

Thanks Nuno. Posted in system scripts now. http://reboot.pro/fi...staller-script/

#4 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 16 September 2011 - 10:12 PM

I occasionally have need to add WAIK packages to my WinPE7_SE build (HTA support, MDAC support, etc). I heavily modifiied a script from Mustang and Khauyeung in order to more efficently acomplish what I wanted to do.

I'm posting the code here currently rather than as a download, because the script is limited to build systems that can use DISM.exe without erroring (which can happen when an earlier version of WinPE7_SE has installed wimfltr.inf on Win 7). Note that the x86 DISM.exe can service an x64 image/packages. Hopefully some will find it useful.

Hi FerrariGuy,

Thanks for this script :)
Good for those who want to use the Waik Package, but personally, I prefer the direct copy of required files, but it is harder to write ;).

If I may, you can use dism from the source x86 or x64, whatever the hostOS, as it is done on Driver Integration


[Process_Win7x86]

StrFormat,CTRIM,%pFileBox86%,\,%pFileBox86%

FileCopy,%BootSRC%\Windows\System32\dism.exe,%TargetDir%\Windows\system32\dism\

FileCopy,%BootSRC%\Windows\System32\wdscore.dll,%TargetDir%\Windows\system32\dism\

IF,%pRadioGroup1%,Equal,0,ShellExecute,Open,%TargetDir%\Windows\system32\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox86%#$q /recurse %unsigned%"

IF,%pRadioGroup1%,Equal,1,ShellExecute,Hide,%TargetDir%\Windows\system32\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox86%#$q /recurse %unsigned%"

 

[Process_Win7x64]

StrFormat,CTRIM,%pFileBox64%,\,%pFileBox64%

FileCopy,%BootSRC%\Windows\System32\dism.exe,%TargetDir%\Windows\system32\dism\

FileCopy,%BootSRC%\Windows\System32\wdscore.dll,%TargetDir%\Windows\system32\dism\

FileCopy,%InstallSRC%\Windows\SysWow64\dism.exe,%TargetDir%\Windows\SysWow64\dism\

FileCopy,%InstallSRC%\Windows\SysWow64\wdscore.dll,%TargetDir%\Windows\SysWow64\dism\

IF,%SysType%,Equal,x64,Begin

  IF,%pRadioGroup1%,Equal,0,ShellExecute,Open,%TargetDir%\Windows\system32\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox64%#$q /recurse %unsigned%"

  IF,%pRadioGroup1%,Equal,1,ShellExecute,Hide,%TargetDir%\Windows\system32\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox64%#$q /recurse %unsigned%"

End

IF,%SysType%,Equal,x86,Begin

  IF,%pRadioGroup1%,Equal,0,ShellExecute,Open,%TargetDir%\Windows\sysWow64\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox64%#$q /recurse %unsigned%"

  IF,%pRadioGroup1%,Equal,1,ShellExecute,Hide,%TargetDir%\Windows\sysWow64\dism\dism.exe,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%pFileBox64%#$q /recurse %unsigned%"

End


For my part, I have no problem with wimfltr and this method.

:cheers:

#5 FerrariGuy

FerrariGuy

    Member

  • Members
  • 50 posts
  • Location:South Carolina
  •  
    United States

Posted 17 September 2011 - 02:17 AM

Thanks for the suggestions ChrisR. They're always appreciated. I like the idea of using the DISM from the Source-->Target OS. I'll revisit this script after I finish up one I'm working on ATM. Currently this is a fairly simple script, but it gets the job done. :thumbsup:

FYI, On my last Win7 x64 sytem I was using winbuilder on, I had installed the 6.0 wilmfilt.inf which caused at least a week of headaches trying to figure out why the 6.1 DISM would error out in certain operations. As it turned out, it is possible to have some serious problems w/ DISM if it is mismatched with the WIM mounting driver. :frusty:

#6 pokemon1

pokemon1

    Member

  • Members
  • 87 posts
  •  
    United Kingdom

Posted 17 September 2011 - 08:33 AM

Hi FerrariGuy,
I am trying to use your script with Win7PE SE project.
I am getting error that relates to 'space' within the path. It is unable to recognise the argument 'Files\Windows'. So it looks like it is unable to use path with space/s.

I have pointed the default WAIK location i.e. C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-XXX.cab

Edited by pokemon1, 17 September 2011 - 09:11 AM.


#7 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 17 September 2011 - 09:10 AM

Pokemon1, by just adding Quote in the package Path it should work.
/PackagePath:#$q%pFileBox1%#$q"

About wimfltr, not easy, it seems that there are somes conflicts between wimflt and wimmount drivers
For /mount with wimmount.sys driver some people have noted problems when wimfltr is running.
It seems OK for /Add-Driver, I don't know for /Add-Package.

:cheers:

#8 fedek9001

fedek9001
  • Members
  • 1 posts
  •  
    American Samoa

Posted 19 November 2011 - 04:02 PM

not working for me :

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385


Error: 0xc150003a

An error occurred while loading DISM. The DISM tool may be corrupt.
Try reinstalling DISM.

The DISM log file can be found at C:WindowsLogsDISMdism.log




WinPE7_SE_7_22_2011

win7 x86 enterprise as source

Edited by fedek9001, 19 November 2011 - 04:04 PM.


#9 turbobaby

turbobaby
  • Members
  • 3 posts
  •  
    Germany

Posted 13 March 2012 - 08:48 PM

not working for me :

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385


Error: 0xc150003a

An error occurred while loading DISM. The DISM tool may be corrupt.
Try reinstalling DISM.

The DISM log file can be found at C:WindowsLogsDISMdism.log




WinPE7_SE_7_22_2011

win7 x86 enterprise as source


I have this Problem too with Win7 x86 enterprise without SP

What can i do?
  • dam38 likes this

#10 Dimonius

Dimonius
  • Members
  • 4 posts
  •  
    Poland

Posted 24 March 2015 - 01:13 PM

Hi,

Please help, script for me dont work :

DISM log :

Spoiler

and cmd information:

Spoiler

Any ideas?

any



#11 Dimonius

Dimonius
  • Members
  • 4 posts
  •  
    Poland

Posted 24 March 2015 - 01:24 PM

I use Extracted wim folders (Instead of mounting images)...



#12 Dimonius

Dimonius
  • Members
  • 4 posts
  •  
    Poland

Posted 24 March 2015 - 01:52 PM

Everything is work ! :clap: Thx!!!



#13 Dimonius

Dimonius
  • Members
  • 4 posts
  •  
    Poland

Posted 24 March 2015 - 01:52 PM

del


Edited by Dimonius, 24 March 2015 - 01:53 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users