PowerShell Application wrapper for Standalone,MDT and SCCM

Update 2016-08-02: Someone asked, could it not be possible to run external vbs and ps1 scripts as well. Well hat has now been fixed and the new version is available for download.
Current versions support the following installertypes, EXE/MSI/MSP/VBS/PS1. Happy deploying!

My good friend “The Deployment Bunny” did a while back a nice script to install Internet Explorer 11 into a ref image. I now needed a nice way to deploy other applications using the same principle and way to deliver this to customers.
The problem now is most don’t want to edit the script every time a new application should be used. To sort this out the script uses a settings.xml file to specify the needed parameters.
The XML in itself is a short simple one as can be seen below.

<xml>
<Application>
<Name>Oracle Java <InstallerName>jre-8u40-windows-i586.exe</InstallerName>
<InstallerType>EXE</InstallerType>
<InstallSwitches>/s</InstallSwitches>
</Application>
</xml>

Now all that has to be changed for this to work with other applications is the Name, the file to run and the install switches. If you change to run a MSI instead just change installertype to MSI.
The folder structure for it to work needs to look like this and the install files is then place inside the Source folder.

Install-AppScript

This can then either be run by simply running the PowerShell script from the folder or by calling on it from inside SCCM or MDT. The Install command from MDT and SCCM is then “cmd /c PowerShell.exe –ExecutionPolicy ByPass –File install-applications.ps1”
If you run this inside of MDT or SCCM and in a Task sequence the logging will be done to the relevant logfolders used by MDT and SCCM.

The script can and a sample settings.xml can be downloaded from here http://bit.ly/1TAdgEh

Happy deploying!

Advertisements

8 comments

  1. If I run this using CMD it works fine. I’ve tried this with your Oracle example and a few other MSI and EXE installs.

    If I run it via MDT, I’m getting: “Application [NAME] returned an unexpected return code: -196608”.

    My Application details look like this:
    cmd /c PowerShell.exe -ExecutionPolicy Bypass -File Install-Application.ps1

    Any ideas?

    Like

    1. hey, that is because mdt nativley starts all applications with cmd /c so your commandline will cause a double cmd /c and that wont work. Just remove the cmd /c part from your application command and it should be fine.
      /Peter

      Like

  2. Thanks for the great wrapper!
    What about starting .vbs or .ps1 the same way as .msi & .exe?

    It happens quite often that you have to script something before or after installation, and it would be good to do it with the same method through an external script instead of having to make changes in the installation script.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s