Wednesday, October 28, 2015

Silently Deploy IBM SPSS 23



Deploying SPSS 23 is much like deploying SPSS 22. There is one notable difference I have found in regards to deploying using the AUTHCODE parameter. There appears to be a bug in the MSI that when the AUTHCODE parameter is used, the spssprod.inf configuration file in the SPSS 23 directory is created with a blank value for DaemonHost, where it should have the value no-net (if using a site license parameter this value will have the name of your license server). I found information about this bug at the IBM support site (you might have to have an IBM account and access to the site to view the whole bug report) https://www-304.ibm.com/support/entdocview.wss?uid=swg1PI37055 . You will notice this bug happening because all the modules for SPSS will not load during installation because your license is not functioning correctly.


Taking the information about this bug, I created a PowerShell script that would edit the spssprod.inf file at the end of the installation and put in DaemonHost=no-net. The script checks for the existences of  the exact string "DaemonHost= ". Notice the space after the = sign. If that string exists exactly, it will replace it with DaemonHost=No-Net. That way if the MSI is ever fixed, or happens to function correctly my install script does not ruin the install by trying to correct an already correct config file.


Here is the script I use for laptops (with AUTHCODE parameter)
# Uninstall all old SPSS's and PASW's that are installed!
$Installs = get-wmiobject -namespace root\cimv2\sms -query "select * from SMS_InstalledSoftware where ProductName like '%Statistics%'"
foreach ($Install in $Installs)
{
 if (($Install.Productname -match "(IBM SPSS)") -or ($Install.Productname -match "PASW"))
 {
  $Install.productname
  $software = $Install.softwarecode
  $UninstallArgs = "/x $software /qn /norestart ALLUSERS=1 REMOVE=`"ALL`""
  start-process msiexec.exe -ArgumentList $UninstallArgs -wait
 }
}

# Begin Installation SPSS22 with Offline License, update for new versions
$SPSSArgs = '"IBM SPSS Statistics 23.msi" AUTHCODE="yourlicensecodehere" INSTALLPYTHON="1" ENABLE_JAB="1"'
$MSIexecArgs = "/qn ALLUSERS=2 /m MSIUQUPQ /norestart /i"
Start-Process msiexec.exe -ArgumentList "$MSIexecArgs $SPSSArgs" -Wait

# Enable UUENCODING for all users, update for new versions
reg add HKLM\Software\JavaSoft\Prefs\com\ibm\/S/P/S/S\/Statistics\23.0\ui\dialog_settings\welcome_page /v show_unicode_warning /d 1 /f
reg add HKLM\Software\JavaSoft\Prefs\com\ibm\/S/P/S/S\/Statistics\23.0\ui\dialog_settings\welcome_page /v shown_unicode_warning /d 1 /f

<# 
Edit spssprod.inf file to fix issue with IBM's version 23 installer when using AUTHCODE
Line should read "DaemonHost=no-net" instead of being blank. This will add no-net if it is blank.
Check if still needed in newer versions. 
#>
$spssprod = get-content $ENV:ProgramFiles\IBM\SPSS\Statistics\23\spssprod.inf
if ($spssprod -match "^DaemonHost=\s$")
    {
    $spssprod.replace('DaemonHost=','DaemonHost=no-net') | set-content $ENV:ProgramFiles\IBM\SPSS\Statistics\23\spssprod.inf
    } 

For completeness here is the script I am using for Desktop installs using a license server:
# Uninstall all old SPSS's and PASW's that are installed!
$Installs = get-wmiobject -namespace root\cimv2\sms -query "select * from SMS_InstalledSoftware where ProductName like '%Statistics%'"
foreach ($Install in $Installs)
{
 if (($Install.Productname -match "(IBM SPSS)") -or ($Install.Productname -match "PASW"))
 {
  $Install.productname
  $software = $Install.softwarecode
  $UninstallArgs = "/x $software /qn /norestart ALLUSERS=1 REMOVE=`"ALL`""
  start-process msiexec.exe -ArgumentList $UninstallArgs -wait
 }
}

# Begin Installation SPSS22 with Network License, update for new versions
$SPSSArgs = '"IBM SPSS Statistics 23.msi" LICENSETYPE="Network" LSHOST="yourlicenseserverhere" DISABLE_COMMUTE="1" INSTALLPYTHON="1" ENABLE_JAB="1"'
$MSIexecArgs = "/qn ALLUSERS=2 /m MSIDWWPE /norestart /i"
Start-Process msiexec.exe -ArgumentList "$MSIexecArgs $SPSSArgs" -Wait

# Enable UUENCODING for all users, update for new versions
reg add HKLM\Software\JavaSoft\Prefs\com\ibm\/S/P/S/S\/Statistics\23.0\ui\dialog_settings\welcome_page /v show_unicode_warning /d 1 /f
reg add HKLM\Software\JavaSoft\Prefs\com\ibm\/S/P/S/S\/Statistics\23.0\ui\dialog_settings\welcome_page /v shown_unicode_warning /d 1 /f



As usual with my posts, these scripts are designed to deploy using SCCM.

Allowing Non Server Admins to Build Pharos Printing Packages


In our environment, our application administrators are not always the same people as our server administrators. This led to a problem with Pharos, a product we use for our pay for print system. To build or rebuild a package of printers in Pharos, the user had to also be an administrator on the server. So I broke out procmon and got down to figuring out what type of access a user would need to be able to build packages. It turned out to be fairly simple. I created an AD group, put the Pharos Administrators in the new group and gave that group:

Modify access to C:\inetpub\wwwroot\Uniprint
Full control on C:\Program Files (x86)\Pharos\Bin

In the server's registry, gave the group:
Full Control on HKLM\Software\Wow6432Node\Pharos
Full Control on HKLM\System\CurrentControlSet\Services\WinSock2\Parameters