To install liberaGIS over a network, here is an example of a script:
@echo off
start /b /wait "" "%~dp0Setup_TerrSet_liberaGIS_20_00.exe" /Silent /L="C:\TEMP\TER_INST_LOG.TXT" TARGETDIR="C:\Program Files (x86)\TerrSet_liberaGIS" DESKTOPDIR="C:\Users\Public\Desktop\" SHORTCUTFILES="C:\Users\Public\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\" QUICKLAUNCHDIR="C:\Users\Public\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\" USERNAME=CLARK USERCOMPANY="CLARK" ALLUSERS=TRUE COMPLETE=TRUE SILENT=TRUE
timeout /t 15
To install liberaGIS over a network to take the place of an existing TerrSet2020 installation, here is an example:
@echo off
start /b /wait "" "%~dp0Setup_TerrSet_liberaGIS_20_00.exe" /Silent /L="C:\TEMP\TER_INST_LOG.TXT" TARGETDIR="C:\Program Files (x86)\TerrSet2020" DESKTOPDIR="C:\Users\Public\Desktop\" SHORTCUTFILES="C:\Users\Public\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\" QUICKLAUNCHDIR="C:\Users\Public\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\" USERNAME=CLARK USERCOMPANY="CLARK" ALLUSERS=TRUE COMPLETE=TRUE SILENT=TRUE
timeout /t 15
Thanks to Becky in Clark's ITS for help with the above script!!!
How I got the script to work.
Based on instructions in ZineTek’s video: https://www.youtube.com/watch?v=-4OX6DETHNg
- Get administrative rights for the remote computer(s).
- Enable Powershell remoting on remote computer(s):
- On the remote computer, Open a cmd prompt as Administrator
- >powershell
- >enable-psremoting –force
- From the Start menu, search on Firewall. Find Windows Defender Firewall with Advanced Security. Right-click on it and Run as Admin.
- Inbound Rule – right-click -> New Rule.
- Predefined
- In Combo box, choose Windows Remote Management
- Next
- Leave Public unchecked; Check on Domain, Private.
- Allow the Connection
- Finish
- Inbound Rules – right-click – Refresh
- Verify that Windows Remote Management (for Domain, not public) is enabled/yes.
- Inbound Rule – right-click -> New Rule.
- On local computer, download the installation setup file. Put it into the folder that you specify in your script.
- Run the script in your local Powershell. The script I used was:
#Define the remote computer name and MSI package path
$ComputerName = "TNT1"
$DestFolderPath = "c:\temp"
$FilePath = "c:\temp\setup_terrset_liberaGIS_20_00.exe"
#create a new Powershell session to the remote computer
$Session = New-PSSession -ComputerName $ComputerName
#Create the destination folder if doesn't already exist
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
param($DestFolderPath)
if (!(Test-Path $DestFolderPath)) {
New-Item -ItemType Directory -Path $DestFolderPath
}
} -ArgumentList $DestFolderPath
# Copy the setup package to the remote computer
Copy-Item $FilePath -Destination $DestFolderPath -ToSession $Session
# Install the setup EXE on the remote computer
Invoke-Command -Session $Session -ScriptBlock {
param($FilePath)
cmd /c start /b /wait "" $FilePath /Silent /L="C:\TEMP\TER_INST_LOG.TXT" TARGETDIR="C:\Program Files (x86)\TerrSet_liberaGIS" DESKTOPDIR="C:\Users\Public\Desktop\" SHORTCUTFILES="C:\Users\Public\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\" QUICKLAUNCHDIR="C:\Users\Public\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\" USERNAME=CLARK USERCOMPANY="CLARK" ALLUSERS=TRUE COMPLETE=TRUE SILENT=TRUE
} -ArgumentList $FilePath
# Remove the copied setup package from the remote computer
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
param($FilePath)
Remove-Item $FilePath -Force -Recurse } -ArgumentList $FilePath
#Close the powershell session tothe remote computer
Remove-PSSession $Session
0 Comments