Windows Application Packaging for Microsoft Intune

Author by Johnathon Biersack

Although most of the engagements that I’ve seen with Microsoft Intune tend to focus on Mobile Device Management, Microsoft Intune is also a very useful tool for cloud based management of Windows PCs. Offering inventory reporting, Windows update management, software deployments and malware tools; it is a great solution for small to midsize businesses looking to cut the cable to their on-premises infrastructure. It does a good job of letting you manage domain joined or non-domain joined Windows OS devices without the need to stand up any infrastructure.

One of the issues that I see a lot of people struggle with the most when deploying software through Intune, either it being simple installations to complex packages, is the software deployments will often fail. However, using some open source applications along with the time-tested batch file we can create a simplecomplex, and even chained installation packages that will successfully install on the machine.

We are going to use a few pieces of software to help us create this executable:

 

1. First, start by downloading and installing the 7-Zip File Manager from the 7-Zip website. (http://7-zip.org)

102215_0217_WindowsAppl1.png

2. Once downloaded, installed the 7-Zip application. Once completed go back to the 7-Zip website and navigate to the Download section of the website.
102215_0217_WindowsAppl2.png
 
3. On the download page, scroll down to the 7-Zip non-beta table and download the package that includes the SFXs for installers.
102215_0217_WindowsAppl3.png


4. Once that download is completed create a folder for the package we are about to create. Open the7z920_extra.7z file and extract the 7zS.sfx file into that folder. We will use it later when creating the package.
102215_0217_WindowsAppl4.png
5. Next, open the contents of the original installation application package that you’ve received from the developer in the 
7-Zip File Manager. Simply right click the the .EXE and select Open Inside to see the executable’s file contents and extract them to another folder.

102215_0217_WindowsAppl5.png

After extracting the contents of the executable navigate to the folder where you extract the content through
 7-Zip File Manager address bar. (Note: You may not have had to extract the contents depending on how your received your software)

102215_0217_WindowsAppl6.png

6.
 Highlight all the files in the File Manager and select Add on the top ribbon. A dialog box will appear. Change the path to the folder we originally created by clicking on the three . Change the compression level to Ultra and then select Ok. The compression may take a while depending on how large the software. Once completed you can close out of 7-Zip File Manager.

102215_0217_WindowsAppl7.png

NOTE: Depending on how the original installer works determines on how we create a batch script to install the software. In this case the package installs a prerequisite before installing the software. We also have a registry modification that we make at the end of the installation so we will also add that change as well.

 

7. We are going to use the Universal Silent Switch Finder tool (http://goo.gl/xwamjN) to help determine what the silent switches are on this packages .MSI/.EXE files.

Open USSF.exe. Once the application is open select the button to navigate to the MSI/EXE file we wish to find the silent switch. Then select Open.

102215_0217_WindowsAppl8.png


8. The dialog boxes will change in the Universal Silent Switch Finder and under the Usagesection you will see how to use this executable as a silent installer. In this case it is msi.exec.exe /I “Spectrum Workstation.msi” /qb. Now you can go ahead and do that for the remaining required installs that are in this application.

102215_0217_WindowsAppl9.png

9. Now that we have the silent install switches we can go ahead and create the batch script for this application. In the folder we created originally that now has the 
7zS.sfx and the Spectrum.7z, right click and create a new Text Document.

102215_0217_WindowsAppl10.png

 

10. Name this document install.bat.

Note: If it creates the file as install.bat but doesn’t show as a type Windows Batch File, make sure you have Show File Extensions enabled and rename it to from install.bat.txt to install.bat

102215_0217_WindowsAppl11.png

11. Open install.bat in notepad. This is where we will put in the silent install commands for this app package. Make sure you put the commands in order of installation.

102215_0217_WindowsAppl12.png

 

I went ahead and added the registration fix at the end of the installs so the user or admin would not have to go back and do that later.

12. Save the bat file in the same location. In that same folder open the .7z file we created earlier in 7-Zip File Manager. Copy the install.bat file into the 7-Zip File Manager. You will be prompted to copy the file. Select Yes.

102215_0217_WindowsAppl13.png

13. Next, in the same folder, create a new Text Document called config.txt.

102215_0217_WindowsAppl14.png


14. Open the config.txt file and type in the following:

;!@Install@!UTF-8!
Title="Spectrum"
Progress="no"
RunProgram="install.bat"
;!@InstallEnd@!

102215_0217_WindowsAppl15.png


Make sure the RunProgram command is pointed to the .bat file that you’ve created and inserted into the .7z file and the Progress is set to no(Progress=”no” means the exe we create will run as a silent install)

15. Next, open a Command Prompt as Administrator.

102215_0217_WindowsAppl16.png

16. Navigate to the folder we created before by using 
cd c:\path to the folder\

102215_0217_WindowsAppl17.png


 

17. Create the new silent install executable by using the command copy /b 7zS.sfx + config.txt + Spectrum.7z Spectrum.exe

Note:
Make sure that to put the executable name at the end with .exe or the files we have created will become corrupted and the complete process will have to be restarted from the beginning

102215_0217_WindowsAppl18.png

18. Once completed you will see the executable in the folder.

102215_0217_WindowsAppl19.png

 

19. You can now upload that .EXE to Microsoft Intune. It does not require any arguments and it will automatically perform a silent install when pushed to managed computers.


 
Author

Johnathon Biersack

Associate Systems Engineer