From OCS Inventory NG
Jump to: navigation, search

How to generate an MSI file associated with OCS Agent


An MSI file is an executable format developed by Microsoft for installing, updating and uninstalling software for Windows operating systems.

The advantage of this file is that it can be integrated in an Active Directory domain to be deployed silently. The following procedure will generate the file associated with OCS Inventory NG Agent.


You must ensure that you have :

Generating MSI file

All operations are performed in a temporary working directory, C:\MSI in this example. We invite you to do so by creating it too.

Making self-extracting certificate file

Note: This step is optional if you are not using SSL in OCS Inventory NG. However, for security reasons, we strongly advise you to generate one. For doing this, follow this link.

In C:\MSI, create a folder called OCS Inventory NG, then create a subfolder called Agent. Copy in this one the cacert.pem file you create for SSL. The result should be like the picture below :

MSI 1.png

Come back to C:\MSI directory. Right click on the OCS Inventory NG folder. A context menu appears. Choose 7-Zip, then Add to archive. A window opens, allowing the generation of a self-extracting file. Set only these parameters :

  • Archive : put cacert.exe
  • Archive format : choose 7z
  • Compression : select None
  • Options : check Create a SFX archive

Your window should look like this :

MSI 2.png

Confirm with OK. Your self-extracting certificate is ready. You can delete the C:\MSI\OCS Inventory Agent directory. Let's go to the next step.

Making MSI file

Get the latest version of the OCS Agent available on the website in the Downloads section, unzip only the OCS-NG-Windows-Agent-Setup.exe file and copy it in the C:\MSI folder. Rename it into OCSAgent.exe to avoid long names.

Launch WIWW 0.2.0 application. Click Next. Choose Create a new Windows Installer msi file option then click Browse. Navigate to C:\MSI folder and type in File Name OCSAgent. Click Save.

MSI 3.png

Click Next.Here we will add commands to install at first the certificate (if necessary), then in a second step the OCS Agent. Click Add and fill in the fields as follows :

  • Select a Windows Installer Folder properly : check Use [Source Dir]
  • Browse or type the program to run : enter exactly cacert.exe
  • Specify any program parameters : enter exactly -y -o"[CommonAppDataFolder]"

MSI 4.png

Confirm with OK. Your certificate is listed in the MSI file. Do the same with the OCSAgent.exe file. Click Add again and fill in as follows :

  • Select a Windows Installer Folder properly : check Use [Source Dir]
  • Browse or type the program to run : enter exactly OCSAgent.exe
  • Specify any program parameters : enter the options that you want to apply to the Agent, for example /S /Server=http://ocsinventory-ng/ocsinventory /SSL=1 /NOW

MSI 5.png

Confirm with OK. Your OCS Agent is listed in the MSI file. You must have this :

MSI 6.png

Click Next twice. Here, if you do not want to see the MSI file in the menu Add/Remove Programs in Windows, you could check Prevent application from being displayed, like this :

MSI 7.png

Click Next. Enter the version of the Agent in Product Version field, for example 2.00.20. Click Next and check the summary. If everything is correct, click Next then Finished. Your MSI file is ready.

MSI 8.png
MSI 9.png

Example of use

Your MSI is ready for use in a group policy. Here is a Howto explaining how to integrate an MSI file in an Active Directory Group Policy. However, keep in mind that the three files cacert.exe, OCSAgent.exe and OCSAgent.msi must be present in the same shared folder for a perfect instllation.