update for exe installer
This commit is contained in:
+37
-12
@@ -1,15 +1,40 @@
|
||||
## Path to the MSI installer
|
||||
$MSIURL = 'https://enscape-installer.chaosgroup.com/installer.enscape.io/Enscape-4.0.0.579.exe'
|
||||
# Path to the MSI installer
|
||||
$URL = 'https://enscape-installer.chaosgroup.com/installer.enscape.io/Enscape-4.0.0.579.exe'
|
||||
|
||||
## Run the installer
|
||||
$INSTALLER = Download-File -URL $MSIURL
|
||||
Write-Output "Installing Enscape from ""${INSTALLER}"""
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart ACCEPTEULA=1 ALLUSERS=1" -Wait -ErrorAction Stop }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
# Set path to temp directory
|
||||
$TEMPDIR = '{0}enscape-installer' -f (Get-TempPath)
|
||||
|
||||
## Delete installer
|
||||
Try {
|
||||
Write-Output "Deleting downloaded installation package"
|
||||
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
|
||||
# Recursively delete $TEMPDIR if it already exists
|
||||
If ( Test-Path $TEMPDIR ) {
|
||||
Write-Output """${TEMPDIR}"" already exists and will be deleted"
|
||||
Try { Remove-Item -Path $TEMPDIR -Recurse -Force -ErrorAction SilentlyContinue }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
}
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
|
||||
# Create $TEMPDIR
|
||||
Write-Output "Creating: ${TEMPDIR}"
|
||||
Try { New-Item -Path $TEMPDIR -ItemType Directory -Force -ErrorAction Stop }
|
||||
Catch { Write-Error $_.Exception.Message ; Return }
|
||||
|
||||
# Write $CONFIG to config.xml
|
||||
$CONFIG = @'
|
||||
<DefValues>
|
||||
<Value Name="INSTALL_SKETCHUP" DataType="value">1</Value>
|
||||
<Value Name="STDROOT" DataType="value">C:\Program Files\Enscape</Value>
|
||||
<Value Name="INSTALL_RHINO" DataType="value">1</Value>
|
||||
<Value Name="INSTALL_ARCHICAD" DataType="value">1</Value>
|
||||
<Value Name="LOCALE" DataType="value">en-US</Value>
|
||||
<Value Name="INSTALL_REVIT" DataType="value">1</Value>
|
||||
<Value Name="INSTALL_VECTORWORKS" DataType="value">1</Value>
|
||||
</DefValues>
|
||||
|
||||
'@
|
||||
Try { $CONFIG | WriteToFile_UTF8NoBOM -FilePath "${TEMPDIR}\config.xml" }
|
||||
Catch { Write-Output "Cannot write configuration file! This script will exit." ; Write-Error $_.Exception.Message ; Return }
|
||||
|
||||
# Download the installer
|
||||
$Installer = "${TEMPDIR}\$(Split-Path $URL -Leaf)"
|
||||
Download-File -URL $URL -File $Installer
|
||||
|
||||
# Install package
|
||||
Install-Program -Path $Installer -Arguments "-gui=0 -acceptEULA -configFile=""config.xml"" -quiet=1 -ignoreErrors=1" -Delete
|
||||
|
||||
Reference in New Issue
Block a user