How to register OCX with SCCM 2012

Today, I’d a new challengue in my Customer. They needed to register a OCX to all their computer clients.

Perfect!! Start the party…

First of all, we need to create a folder in the SCCM repository. Copy in this folder this files and folders:

OCX SCCM Structure folder

Where in the folder OCXFile is located the OCX file. To register the OCX I’ve a cmd file like this one (RegisterOCX.bat):

@echo off

xcopy .\OCXFile\*.* “%programfiles(x86)%\FolderOCX” /e /c /i /g /h > nul

regsvr32 /s “%programfiles(x86)%\FolderOCX\OCXFile.ocx”

And to unregister the OCX I’ve this other cmd file (UnregisterOCX.bat):

@echo off

regsvr32 /u /s “%programfiles(x86)%\FolderOCX\OCXFile.ocx”

rd /S /Q “%programfiles(x86)%\FolderOCX”

Now, we only need to create a Application:

-Application with manually specify the aplication information

-Add a Deployment Type Manually, and with Type “Script Installer”

-Select Content Location. Folder created first of all.

-Select in “Installation Program” the RegisterOCX.bat

-Select in “Uninstall Program” the UnregisterOCX.bat

-Add a Clause to detect if the package is or not installed. For example, if exist the file ocx in the “%ProgramFiles(x86)%\folderOCX”

-Follow the wizard

Now, we can distribute the package to DP, and deploy to the target collection to install (register) or uninstall (unregister).

Enjoy,

JoanD

 

Advertisements

Published by

onlyit

Ingeniero de Sistemas, amante de la tecnología e informática.

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