From 2dd6384c579cd6c51b56e9e30050db8fe5646b93 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Wed, 3 Jul 2024 16:53:29 -0400 Subject: [PATCH] exit if specific apps are running at the time of install --- Install-Enscape.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Install-Enscape.ps1 b/Install-Enscape.ps1 index f37ae16..13d455b 100644 --- a/Install-Enscape.ps1 +++ b/Install-Enscape.ps1 @@ -1,4 +1,15 @@ -# Path to the MSI installer +# Exit early if apps are running +$ExitEarly = $false +$AppNames = @() +If ( IsRunning -Name 'revit' ) { $ExitEarly = $true ; $AppNames.Add('Revit') } +If ( IsRunning -Name 'sketchup' ) { $ExitEarly = $true ; $AppNames.Add('SketchUp') } +If ( IsRunning -Name 'archicad' ) { $ExitEarly = $true ; $AppNames.Add('ArchiCAD') } +If ( IsRunning -Name 'autocad' ) { $ExitEarly = $true ; $AppNames.Add('AutoCAD') } +If ( IsRunning -Name 'rhino' ) { $ExitEarly = $true ; $AppNames.Add('Rhino') } +If ( IsRunning -Name 'vectorworks' ) { $ExitEarly = $true ; $AppNames.Add('VectorWorks') } +If ( $ExitEarly ) { Write-Output "Installation cannot continue because the following apps are running: ${AppNames}." ; Return } + +# Path to the MSI installer $URL = 'https://enscape-installer.chaosgroup.com/installer.enscape.io/Enscape-4.0.2.11.exe' # Set path to temp directory