/build/static/layout/Breadcrumb_cap_w.png

How to renew the SAS 9.3 license.

I am a newbie to software deployment with KACE, but I'd like to see if I can make this work.

We use SAS 9.3 in both the 64 abd 32bit versions in our environment.  I'd like to be able to renew the license using KACE.  I have a batch file that works for each version of the software.  They both call the sasrenew.exe file from a different directory based on which version is installed.  If possible, I'd like for it to check for the existing of the directory and file (i.e. "C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe", or "C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe" ) then run the batch file that uses the right version of the license file ("-skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_Wrkstn.txt", or -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_X64_Wrkstn.txt"). 

Darrell

2 Comments   [ + ] Show comments
  • It's not the processor that would determine the version in this case, it is the installed version of the software. Some of the machines have the 32bit version installed even though their processor is 64bit, and some of them have the 64bit version of the software installed. - darrelleddy 9 years ago
  • ...so detect the installed version by interrogating the 'Uninstall\[ProductCode]' entry in the registry.

    Personally, I'd be doing that in VBScript rather than batch, mostly because of its superior error-handling. - anonymous_9363 9 years ago

Answers (3)

Posted by: SMal.tmcc 9 years ago
Red Belt
0
not sure on the exact verbage but this will give the right idea.  rewrite your batch file like this:

if "%PROCESSOR_ARCHITECTURE%"=="x86"  C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_Wrkstn.txt

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_X64_Wrkstn.txt
Posted by: SMal.tmcc 9 years ago
Red Belt
0
Oh sorry you can use this in batch processing

if exist {insert file name here} {action}

for example, this opens notepad on autoexec.bat, if the file exists:

if exist c:\autoexec.bat notepad c:\autoexec.bat
Posted by: anonymous_89149 9 years ago
Yellow Belt
0

 We use SCCM + a batch file

The line that checks the SAS version in our renewal script is :
"dir "c:\program files\sasHome\licenses\*Win_X64_Wrkstn.txt" /b /a | find /v "nofiles">nul || goto 32Bit"

Basically does a dir, if it doesn't find any files that end in Win_X64_Wrkstn.txt it assumes it is the 32bit version and uses the appropriate update path/file 


Below is the full script: 

---------------------------------------------------------------------------------------

@echo off

:: SAS Annual License renewal.


::Prep
set SAS32bitKey=SAS93_XXXXXXXXXXXX_Win_Wrkstn.txt
set SAS64bitKey=SAS93_XXXXXXXXXXXX_Win_X64_Wrkstn.txt


echo. >>%windir%\temp\SAS-Renewal.log
echo %date% %time% Starting >>%windir%\temp\SAS-Renewal.log

:: check that SAS is the right version (currently 9.3)
dir "c:\program files\sas_license\SAS93*" /b /a | find /v "nofiles">nul || goto abort
::check if SAS install is 32 or 64bit
dir "c:\program files\sasHome\licenses\*Win_X64_Wrkstn.txt" /b /a | find /v "nofiles">nul || goto 32Bit


:64Bit
echo 64bit license being renewed >>%windir%\temp\SAS-Renewal.log
::Copy renewal license
copy  %SAS64bitKey% "C:\Program Files\Sas_license" /y >>%windir%\temp\SAS-Renewal.log
::Renew License - note path is different to 32bit install
"C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe" -s "datafile:C:\Program Files\Sas_license\%SAS64bitKey%"
goto eof

:32Bit
echo 32bit license being renewed >>%windir%\temp\SAS-Renewal.log
::Copy renewal license
copy %SAS32bitKey% "C:\Program Files\Sas_license" /y >>%windir%\temp\SAS-Renewal.log
::Renew License - note path is different to 64bit install.
"C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe" -s "datafile:C:\Program Files\Sas_license\%SAS32bitKey%"
goto eof


:abort
echo wrong SAS version aborting >>%windir%\temp\SAS-Renewal.log
exit 1603

:eof

::force a 15 sec delay
timeout /t 5 /nobreak >null
set SAS32bitKey=
set SAS64bitKey=
echo %date% %time% Finished >>%windir%\temp\SAS-Renewal.log

--------------------------------------------------------------------------------------------------

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ