SAS license renewal

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Deploying a new SAS license file (SID file) silently is described at http://support.sas.com/documentation/installcenter/en/ikwinri/64446/PDF/default/setinit.pdf

You must change default SAS configuration file when running as SYSTEM user due to missing Documents folder of that user as described at http://www.sascommunity.org/wiki/Errors

Create your own temporary sasv9.cfg file containing:

-config "C:\Programme\SASHome\SASFoundation\9.3\nls\de\sasv9.cfg"
-SASUSER        '%TEMP%\My SAS Files\9.3\'
-SET MYSASFILES '%TEMP%\My SAS Files\9.3\'


and put it to your %SOFTWARE% folder.

The SID file name is in the format SAS93_order-number_site-number_host-platform.txt

You can deploy SID files by WPKG using this package:

  <package id="saslicense" name="SAS License file" reboot="false" priority="100" revision="%version%">
  <variable name="version" value="20130413" />
  <!-- Current date as version number, just update if a new license file should be applied --> 
  <variable name="sasversion" value="9.3" />
  <variable name="sas_sidfile_x86" value="SAS93_order-number_site-number_host-platform.txt" />
  <variable name="sas_sidfile_x64" value="SAS93_order-number_site-number_host-platform_X64.txt" />
  <variable name="jmp_sidfile_x86" value="JMP902_order-number_site-number_host-platform.txt" />
  <variable name="jmp_sidfile_x64" value="JMP902_order-number_site-number_host-platform_X64.txt" />
  
  <check type="file" condition="exists" path="%PROGRAMFILES%\SASHome\SASRenewalUtility\%sasversion%\%version%_%sas_sidfile_x86%" />
  
  <!-- Back up the old cfg and replace with a temporary one pointing to a fake user directory --> 
  <install cmd='%COMSPEC% /c copy /y "%PROGRAMFILES%\SASHome\SASFoundation\%sasversion%\sasv9.cfg" "%PROGRAMFILES%\SASHome\SASFoundation\%sasversion%\sasv9.cfg.bak"' >
    <exit code="any" />
  </install>
  <install cmd='%COMSPEC% /c copy /y "%SOFTWARE%\sas\renewal\sasv9.cfg" "%PROGRAMFILES%\SASHome\SASFoundation\%sasversion%\sasv9.cfg"' >
    <exit code="any" />
  </install>
  
  <install cmd='"%PROGRAMFILES%\SASHome\SASRenewalUtility\%sasversion%\SASRenew.exe" -s "datafile:%SOFTWARE%\sas\renewal\%sas_sidfile_x86%"' />
  <install cmd='"%PROGRAMFILES%\SASHome\SASRenewalUtility\%sasversion%\SASRenew.exe" -s "datafile:%SOFTWARE%\sas\renewal\%jmp_sidfile_x86%"' />
  <install cmd='%COMSPEC% /c copy /y %SOFTWARE%\sas\renewal\%sas_sidfile_x86% "%PROGRAMFILES%\SASHome\SASRenewalUtility\%sasversion%\%version%_%sas_sidfile_x86%"' />

  <!-- Restore original cfg --> 
  <install cmd='%COMSPEC% /c copy /y "%PROGRAMFILES%\SASHome\SASFoundation\%sasversion%\sasv9.cfg.bak" "%PROGRAMFILES%\SASHome\SASFoundation\%sasversion%\sasv9.cfg"' >
    <exit code="any" />
  </install>

  <upgrade include="install" />
	
  <remove cmd="cmd /c echo off" >
    <exit code="any" />
  </remove>
  
 </package>

Deployment of JMP SID files not tested, but it should work too.