Thursday, June 26, 2014

Deploy Maxima 5.31.2, (a Computer Algebra System) Silently with Active Setup

While working on a application package for deploying Maxima with SCCM 2012 recently, I found a perfect example of how to build a simple application deployment with Active Setup.

During this application build we are going to:
  1. Install Maxima silently.
  2. Disable ShowTips for each user using Active Setup.
  3. Remove the Firewall block prompt during first run. (I am allowing it through)
  4. Remove Desktop Icon if it exists.
Create a file called hkcumaxima.reg in your source directory. This file should contain:

Windows Registry Editor Version 5.00

This file will be copied into the Maxima program folder during installation. It will be imported into the active setup registry location during logons.

Next create an install.cmd file with the following commands:

@echo off

set loc=%~dp0

"%loc%maxima-5.31.2.exe"  /VERYSILENT /MERGETASKS=!desktopicon

REM ActiveSetup settings
REG ADD "HKLM\Software\Microsoft\Active Setup\Installed Components\HSU-Maxima" /v "StubPath" /t REG_SZ /d "CMD /C REG IMPORT \"%%ProgramFiles(x86)%%\Maxima-5.31.2\hkcumaxima.reg\"" /f
REG ADD "HKLM\Software\Microsoft\Active Setup\Installed Components\HSU-Maxima" /v "Version" /t REG_SZ /d "2,0,0,0" /f

REM Copy Files to Location
XCOPY "%loc%hkcumaxima.reg" "%ProgramFiles(x86)%\Maxima-5.31.2\" /Y

REM Allow program through Firewall
netsh advfirewall firewall add rule name="Enable Maxima" dir=in program="c:\program files (x86)\maxima-5.31.2\bin\xmaxima.exe" remoteip=localsubnet action=allow

if exist "%PUBLIC%\Desktop\xMaxima.lnk" del "%PUBLIC%\Desktop\xMaxima.lnk"


Put these 2 files along with the maxima executable into your source folder and call install.cmd to install.

No comments:

Post a Comment