Share via


How up run a script before installation of application?

Question

Tuesday, December 8, 2015 1:08 PM

I am quite new to Config. Manager so this may be a simple question...

I want to deploy an application via SCCM by using the application's MSI-file. This work fine, but BEFORE the application is installed I want to install a .reg-file i registry on the client by using regedit.exe /s <file>.

How can I configure this? I can probably make a small script that run this, but I also want to use the "automatically detect information..."-option so that I get the correct parameters for the MSI-file. Can I configure installation of the .reg-file as a prereq for the application?

Thor-Egil

All replies (2)

Tuesday, December 8, 2015 1:12 PM ✅Answered | 1 vote

In the application under the deployment method select script installation and not MSI (or simply make the powershell and go change the install and uninstall section of the deployment to point to the script) and make a Powershell script that does what you want and install the application itself.

I know a lot of people like to use this http://psappdeploytoolkit.com/ to install the application.

Me I always make all my application deployment script base this way i can do validation and make custom change during the install. It give you way more control over what append over just pushing a single MSI.

To give you the idea you can have additional loging using powershell also you can install the application and validate the exit code of the MSI and if it's the exit code you want you can after add the reg key so you wont add the customization if the application failed the install.


Tuesday, December 8, 2015 2:25 PM ✅Answered | 1 vote

As a side note, having pre and post actions is high on many peoples wish lists for ConfigMgr and the product group is aware of this. Unfortunately, for the time being, what Frederick outlines above is the best method. Note that it is possible to use task sequences to accomplish this also depending upon exactly what you want to do but you do lose some abilities when using task sequences (like being able to deploy to users or having any user interaction). Also, in ConfigMgr 2012, it's not technically supported to do this (but many folks do it quite successfully) -- to my knowledge, this support statement is supposed to change in v.Next, but I don't know that for absolute certainty.

Jason | http://blog.configmgrftw.com | @jasonsandys