Sunday, 9 August 2015

Windows Post-Install Wizard (WPI) Tips

Some use full commands and silent install switches for adding software and tweaks to WPI the Windows Post-Install Wizard

first DirectX.. grab your self the JUNE REDIST from microsoft
make a folder called DirectX put the exe in their and Right click on it and select "Extract To Here"
not got that extract option?  (install WinRAR its free for basic use)

once you have DirectX extracted to the folder (delete the exe you downloaded, but keep everything that came out of it)  then in WPI use the following command & path to run it

{START} "DirectXInstaller" /MIN /w "%wpipath%\Install\DirectX\DXSETUP.exe" /silent

Its important to remember there is a  "  after the .EXE, then a Space, then the switches
(want to make a complete DirectX Package with it all, read this)

What about adding WinRAR to WIP?
x86 (32bit)
{START} "WinRarx86Installer" /MIN /w "%wpipath%\Install\Software\x86\WinRAR_x86.exe" /s
x64 (64bit)
{START} "WinRarx64Installer" /MIN /w "%wpipath%\Install\Software\x64\WinRAR_x64.exe" /s

if you use the programs name with architecture including as its UNIQUE ID like WINRARX86 and WINRARX64  then you can add the X64 ID to the x86 Exclude box and vice versa (so only 1 can be chosen)

Microsoft Silverlight?  (the singular Q doesn't seam to make it silent any more unless you add /passive)

{START} "MSSLx86Installer" /MIN /w "%wpipath%\Install\Runtime\Silverlight_x86.exe /q /passive

{START} "MSSLx64Installer" /MIN /w "%wpipath%\Install\Runtime\Silverlight_x64.exe /q /passive

Microsoft Download Manager?

"%wpipath%\Install\Software\MS_DL_MAGR.msi" /passive

Hows about a Microsoft .NET exe?

{START} "MSdotNET" /MIN /w "%wpipath%\Install\Updates\NDP452-KB2901907-x86-x64-AllOS-ENU.exe" /passive /norestart

on the Dependency's you could use


so it only shows up on windows 7 systems, or use like

getOSver()="Win7" || "Win8" || "Win8.1"

also note you can run a BAT  or a CMD file simply using


You may also notice some things clash with others, bat and cmd files seam to hold other stuff back while they work, but launching EXE and MSI files can launch multiples at once, in turn (depending on software choices) you may get windows installer service is in use by another processes, or please wait for the other installer to complete.. solution?

well you could impose the WAIT command using  /w
usage wise an example would be...

{START} "MSdotNET" /w /MIN "%wpipath%\Install\Updates\NDP452-KB2901907-x86-x64-AllOS-ENU.exe" /passive /norestart

This shows what's installing on the WPI window
This makes it wait for the current thing running to finish
This runs it minimised to task bar

This would be handy to include with all exe and msi stuff you add, besides the fact you'll save windows installer getting confused, you'll also prevent any MSU files that patch .net failing while .net is actually still installing, but the /w is optional, as is the /MIN.

My little CMD file in action.. that installs the MSU files

the /w command in action making each install wait for the last to finish
Adobe Acrobat Silent Install Switch?

/sAll Run installer in silent mode.
/sPB Silent mode with minimum UI: show the progress bar only.
/rs Reboot Suppress. Setup.exe will not initiate reboot even if it is required.
/rps Reboot Prompt Suppress. If reboot is required, the system restarts without warning.

I would use something like
{START} "AdobeReader" /w /MIN "%wpipath%\Install\Readers\Acrobat.exe" /sAll /rs

something to remember is although seeing progress bars on software lets you know its running all ok, it slows things down (especially if windows is running on a temp native ms video driver)

WPI installing microsoft .net on Windows 7 SP1 followed by its required updates

note the main installer is x86 and x64 (so i added a single entry just for x86) i set up the updates after it (so one does the app & its x86 updates)  Then to save time (and the fact the updates don't do both)  I selected CLONE to make a copy  of the x86 and changed all the x86 references to x64.

when it comes to .NET updates, you could have ONE install listed under (both)
and have option to run ALL the actual updates (under it) BUT with a prefix to define Windows Architecture  before starting the update..

{86} {START} "DotNetX68Up1" /MIN /w "%wpipath%\install\7\Updates\x86\DotNET\NDP45-KB2972107-x86.exe" /passive /norestart

{64} {START} "DotNetX64Up1" /MIN /w "%wpipath%\install\7\Updates\x64\DotNET\NDP45-KB2972107-x64.exe" /passive /norestart

so it has the  {86}  or  the  {x64}  then  {START}  a space between  the   }  {
I also used the get os version to only make it show up on windows 7 (due to the EXE updates not really compatible with 8 or 8.1 as most there .net updates are MSU files)   I also set the "greyed out option" on the x86 to look for the bits64 thing  to set the greyed out on the x64 to the bits32.
This way when the WPI is run on an x64 installed OS it wont even have any visible x86 stuff  and when run on an x86 it won't show any x64 stuff.

 And to further avoid conflicts i also set the dependencies screen to block any x86 UNIQUE ID  if x64 is selected and vice versa under  EXCLUDES on the Dependencies screen.

Why wont reg files work?  its a problem with WPI.. knock off BOTH the  "  " symbols

{REGEDIT} %wpipath%\Install\Tweaks\filename.reg

{REGEDIT} "%wpipath%\Install\Tweaks\filename.reg"

DON'T use the  "  and DON'T add any silent switches (and it'll just work silently)  ;)

Microsoft Office ?{START} "Office2007Install" /w "%wpipath%\Install\Office2007\setup.exe" /config config.xml

note that my config.xml has my serial number in and i removed the !! commented lines so it installs the components i want, but note ive left out the /MIN
(that's so it doesn't run minimised)  i did that for people who run this and use others keys on their systems (so they essentially need to interact, enter their name and their key for them to use it)  So that's not defaulted to  /MIN  (minimise) so you know when its ready to input details.

I guess if your sound drivers pre-loaded you could have it Chain a sound file Before the app link (like i did the .net updates having app and updates on one) what if you actually chain an audio file then the app   (a beep or what ever) so you know when a specific installer is open or pending..
i feel some voice overs coming on for sure LOL.

go on.. seeing as im on a roll.. how about VLC Media Player Silent Install ?
only issue with VLC is you have to set a Language switch (to which English is 1033)

{START} "VLCx86Installer" /MIN /w "%wpipath%\Install\7\Software\x86\VLC_x86.exe" /L=1033 /S

Also note that i use numbers in path for OS version simply because one day they may no longer support that OS with the Latest (this way you always maintain OS backward compatibility as your menu grows)

I also Re-Name them installers to more simple terms (you can get version number by right clicking, hit properties then the version tab)  renaming these installers to simple stuff like JaVa_x86.exe makes it easier to Update your Disc/USB by just getting the latest release and renaming that (rather than having to edit loads of the menu boxes) Though you should change the version details on the box that checks what ver is installed and the visual box offering the software to install, you can get that via the EXE's properties once installed via the ?.?.?.?  options.. The current VLC for example is  ;)

I must be possessed tonight...

MSE Microsoft Security Essentials silent install  (windows must already be activated)

{START} "MSE7x64Installer" /MIN /w "%wpipath%\Install\7\Software\x64\mseinstallx64.exe" /s /runwgacheck /o

you can Remove the  /o  and it'll check online for an update  OR you can leave the /o in place so the nets not required and then just Chain the update exe Under it like this..

{START} "MSE7x64Updater" /MIN /w "%wpipath%\Install\7\Software\x64\mpam-fe.exe"

odd shots of WPI's ive messed about with...
(and NO i wont provide these so don't ask for them)

I have more to add to this post with bits ive been working on, messing about seeing if its a viable platform for servicing my own systems.  At the moment ive been experimenting with software based interfaces for a mate (who owns this blog, that i sometimes write for...)

My own needs would be more suited to Plugns (audio mainly)  VST  (stand alone and installers)  so many installers, registry tweaks and so on (for varied software)  Id like to create an external drive where i can install the likes of "Native Instruments Knokat"  or  "Reason 5"  and have it copy over all the extra stuff for the specific app chosen  (i don't have big terrabytes of drive space on my main computer) So i often make a restore point, install something wildly drive hogging with all its extras and then restore back and install something else..  this menu makes system changes like that a breeze...

Universal Driver Disk Idea
what about a drivers section that shows Nothing (unless that driver is available?)
so you have 3 folders  AnyBIT (drivers working on x86 and x64) then you have an x64 folder and an x86 folder.. In them folders you have the Lan, Modem, Network and so on.. make one lot of folders (then while empty copy them to the other 2 dir's

then place drivers in the folders and rename the exe files to   setup.exe

then in WPI (dependencies tab, bottom LEFT box) you would add the likes of
and so on for each one...  this way only available drivers would show up on the menu  ;)
(speedy way to make these is make one list for AnyBIT)
add them all to the list then in notepad hit edit, find and replace and replace
\86\    and click replace all
(yes i have met people who have taken hours to edit a bat file and list like this LOL)

you can also throw the architecture command in line to avoid the wrong one being installed
{OS=Win8.1} {x64} {START} "PrinterDriver" /w "%wpipath%\Install\Drivers\x64\Printer\setup.exe"
that will make WPI skip it if its ticked on a 32bit running OS

feel free to leave your ideas and tweaks in the comments, they may help me and others get more out of this fantastic program.

Remember WPI uses the &&  ||  phrasing, so you can also define an OS and Architecture in the (bottom left) dependency box so that stuff wont even show up on systems you don't want it to

 this for example would stop it showing up an an x64 windows 8.1 and hide it from every other version of windows its run on
 getOSver()=="Win8.1" && getBits()==32

if you wanted it to run on both, you could simply just state  getOSver()=="Win8.1"
or be cocky and state
getOSver()=="Win8.1" && getBits()==32 || getBits()==64
so its using the AND and the OR statement

If we wanted to Detect something to see if its already installed (so we don't re-install it)
we could use the Dependencies box on the bottom right, so if it detects the file presence AND its actual installed version number, it'll grey out the option to install it.  Using the OR expression you can check both locations (regardless of if its installed in program files.. or program files (x86) by checking Both Paths with the ||   OR in between

getFileVersion("%PROGRAMFILES%\Malwarebytes Anti-Malware\mbam.exe")>="" || getFileVersion("%ProgramFiles(x86)%\Malwarebytes Anti-Malware\mbam.exe")>=""

if its Not installed (OR you have a Newer Version already)  it'll grey out the option to install the you added to your install dir in wpi

It opens up some fantastic ideas if you wanted to make a servicing disk, ber in mind windows 7 for example (be it 7 or 7 SP1) is just  winver 7, so if you put the disk in a none sp1 machine stuff would show up you'd not want available until SP1 was installed...

So you could check for windows 7 && the service pack 1, or you could check for windows 7 so if you wanted to offer the ability to Install SP1, the left box would be

getOSver()=="Win7" && getBits()==32 && getSPver()==0
getBits()==64 && getOSver()=="Win7" && getSPver()==1
the order often has random effects, try your design in different environments

Example on Windows 10 work in progress from an 8.1 template
Example on Windows 8.1

No comments:

Post a Comment

Please keep comments clean...

Note: only a member of this blog may post a comment.