Further update:
Got it working for the most part along with registering the application, only 'issue' is it leaves the 'Registered' window open which is a bit of a pain.
For anyone that cares, in SCCM:
-Create a Standard Application
-For the 'Deployment Type' under the 'Content' tab, leave it blank
--'Programs' tab I have used the following for 'Install':
Code: Select all
powershell.exe -executionpolicy Bypass -file \\ServerFQDN\eViewsSoftwareLocation\InstalleViews.ps1
--'Programs' tab I have used the following for 'Uninstall':
Code: Select all
MsiExec.exe /X{8B48E17F-1487-4641-8005-802689C290BC}
-'Detection Method' tab I used Registry detection
--Type: Registry
--Hive: HKEY_LOCAL_MACHINE
--Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
--Value: {8B48E17F-1487-4641-8005-802689C290BC}
--Data Type: String
--Registry Setting must exist
-'User Experience tab' is set to Install for System and Whether or not a user is logged on
Contents of the PowerShell Script:
Code: Select all
New-item -Name "TEMPeViewsfiles" -Type Directory -Path "C:\" -Force -Verbose
Start-Sleep -s 5
Copy-Item -Path '\\ServerFQDN\eViewsSoftwareLocation\*' -Destination 'C:\TEMPeViewsfiles\' -Verbose
Start-Sleep -s 5
& 'C:\TEMPeViewsfiles\EViews11Installer(64-bit).exe' -s '-f1C:\TEMPeViewsfiles\eViewsScript.iss'
echo Waiting 60s
Start-Sleep -s 60
Write-Host "Attempting to Register eViews installation"
& 'C:\Program Files\eViews 11\EViews11_x64.exe' /registerlicense "*Insert - License - Code*" "*Joe Bloggs*"
Start-Sleep -s 10
Write-Host "Removing Temporary folder TEMPeViewsFiles from C:"
Remove-Item -path C:\TEMPeViewsfiles -Recurse -Verbose
Write-Host "If 'True' is displayed below, installation was successful"
$TRUE
Write-Host "eViews 11 Installed, check exit code below"
$LASTEXITCODE
The 'eViewsSoftwareLocation' in the Script contains the eViews.exe file and the created .ISS files (assuming you are using that)
I could probably try and clear it up a bit more but for whatever reason the original batch file didn't want to work, running it from the local SCCM Cache also wasn't working, hence copying it down locally to execute.
One of the main things stopping my original PowerShell tests from working was the license code in the command line didn't have spaces between the ' - ' characters...Yet when recording the installation it didn't seem to complain about it.
Add logging if required.