jump to navigation

How MDT does Application Installation January 20, 2010

Posted by keithga in MDT 2010, Troubleshooting, VBscript, Windows 7.
trackback

Been working lately on adding some Application Installation packages to MDT, and I’ve seen some good, bad, and ugly packages.

So, what makes an application installation compatible with MDT (or other scripted installation methods, for that matter)?

Good question.

Microsoft Installer (MSI)

The good!

More and more products are being released lately as MSI packages. Most MSI Packages are easy to automate. For example, I typically use the following parameters:

Msiexec.exe /qb- /l*vx  %LogPath%\<file>.log REBOOT=ReallySuppress UILevel=67 ALLUSERS=2 /i <File>.msi

MDT will easily handle this installation script, and install properly for most MSI packages. Yea!

Non-MSI Packages

However, it is possible that you are working with a custom installation package, or perhaps developing your own. What are the rules necessary to make the package work in MDT?

Rule 1: Provide unattended installs

The install program should have a way to install in a unattended manner. Typically this is done by some sort of command line switch to the installer program or script: /quiet /silent /q whatever. MDT 2010 is a fully automated installation system, and the automation will break if there are any user prompts blocking installation.

For example, if you have a MSI installer package, you can call MSIExec.exe with the /q[bn][-] parameter.

This also equally important for errors. If the install package generates errors, it should provide a method to log the errors to a file for analysis later, rather than prompting the user for interaction with a blocking Error Message Box.

Rule 2: Do not exit until done

The install programs should not exit until all setup tasks have finished. If the setup program returns, yet there are still installation tasks being performed in the background, MDT has no way to determine this. So MDT may continue with the next installation, or perhaps a reboot thus causing conflicts with the installation running in the background.

For example, say you have two installation packages, A.Exe and B.Msi. A.Exe is just a Self Extracting Executable that expands A.MSI to the %temp% folder, and kicks off msiexec.exe. However, A.Exe calls msiexec.exe and doesn’t wait, instead A.Exe promptly exits. MDT does not know what is running in the background, and instead continues installing the next package in the list B.Msi. However since A.Msi is running in the backgound, and MSIExec only allows one installation at a time, B.Msi will fail.

Instead A.Exe should wait until Msiexec.exe /i A.msi has finished.

Rule 3: No rebooting

Sometimes an install package will need to reboot to complete the installation. Reboots, for example, are required to update any file that is already open and in use. It’s a common misconception that you need to reboot to install a device driver, you don’t (unless the driver is in use).

However problems arise if the setup program, when running in an unattended matter, decides to reboot on it’s own, without letting the calling script (in this case MDT), know before hand. It may be a couple of seconds before all processes have a chance to shutdown. It’s possible that MDT may try to continue installing the next program in the order or other cleanup tasks, when it shouldn’t.

Instead, a program should return Windows.h Error Code: 3010 ( ERROR_SUCCESS_REBOOT_REQUIRED ).

This will let MDT know that a reboot is required, reboot the machine, and *then* continue with the rest of the installation packages.

Other Notes

There are a few other notes that I wish I could mention to the authors of installation packages:

  • Be aware that the installation may be performed under one user account, but the program may be used under another account. When calling MSIExec.exe, I usually call it with the ALLUSERS=2 property.
  • Please make it easy to determine what the unattended/silent installation procedures are. It’s not always easy to determine what the command line parameters are.
  • If you have a Self Extracting Executable that calls msiexec.exe, please provide a way to pass logging and other properties (see above) to msiexec.exe.
  • Speaking of Self Extracting Exe files that call *.msi packages. Please just provide the *.msi install package, it’s much easier.
  • On your web site, please provide direct access to your install packages, rather than going through some web logic. Several populat sites, for example will attempt to offer you *only* the x86 or x64 binaries depending on which platform you are running on, even though I may need both for packaging.
  • Please keep the desktop free from links/icons, or provide a property in MSI to disable shortcuts creation on the desktop (I’m talking to you Adobe Reader). I like keeping my desktop clean.
  • Speaking of options, please provide ways on the command line to enable/disable most common features.

 

Keith

Keith Garner is a Deployment Specialist with Xtreme Consulting Group

Comments»

1. Erik - January 20, 2010

Great post Keith! I hope this will spread to all developers out there :)

Could you write a similar post dedicated to developers of device drivers ;) ?

2. yet another blog . . . « windows7ROAR - February 24, 2010

[...] February 24, 2010 Posted by examROAR in Uncategorized. Tags: blogs, deployment, MDT trackback on deployment.  some great tips here on MDT application installation.. 0.000000 [...]

jonathon - March 4, 2010

Are there any methods in forcing MDT to wait till an app finishing installing before trying to install the next? EG Autocad, Inventor and Revit. All try to run at once when run through MDT (they are silent but dont wait for the last to finish and not msi. setup.exe with switches).
Great Site by the way. Really good tools

tmintner - March 4, 2010

Thanks Jonathon!

MDT will wait until the application reports that it is finished before moving on to the next application. The challenge is that some applications will start another process and report that setup.exe is finished and then MDT will keep going. The best thing to do in those situations is to use a script to wrap around the application install that will wait until the entire process completes before the script finishes. That is a great idea for another blog post

3. jonathon - March 6, 2010

Ah ok. Thanks I have a script that I am now playing with at this stage It is not working.
Once I get it to work I will post here?

4. Evans - April 22, 2010

My issue is installing applications from another server. Are you able to set a AppRoot like DelpoyRoot?
http://www.minasi.com/forum/topic.asp?TOPIC_ID=33070
arwidmark
So say you have a server named MDT01 where the MDT deployment share is (named MDTProduction$), and then a second server named MDT02 where your application share is (named Applications$). You will see that the task sequence will map Z: to \\MDT01\MDTProduction$, and then map Y: to \\MDT02\Applications$, and then install your application.
How do you set MDT2010 to map Y to my applications server?

tmintner - April 22, 2010

One option is to add a zticonnect step just before the application installation step. You would do a Run Command line with cscript.exe “%scriptroot%\zticonnect.wsf” /uncpath:\\server\share

that will make the connection to that server.

Evans - April 22, 2010

Thanks for the quick reply tmimtner. I added a Run Command Line to the State Restore section in the TS with the following syntax: cscript.exe “%SCRIPTROOT%\ZTIConnect.wsf” /uncpath:\\Server2\Applications$
It does not run for some reason but I can run it manually using:
cscript.exe “\\Server1\Distribution$\Scripts\ZTIConnect.wsf” /uncpath:\\Server2\Applications$
Any thoughts?