File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,7 +208,16 @@ if(!([System.Environment]::Is64BitOperatingSystem) -or !(([System.Environment]::
208208}
209209
210210# Set root path for setup with fallback to the default path
211- if (! (Test-Path - PathType Container - Path $WCMP.Config.Path )){
211+ if ($WCMP.Config.Path -and ! (Test-Path - PathType Container - Path $WCMP.Config.Path )){
212+ try {
213+ $WCMP.Info (' Creating installation directory "' + $WCMP.Config.Path + ' "...' )
214+ New-Item - Path $WCMP.Config.Path - ItemType Directory | Out-Null
215+ $WCMP.Info (' Installation directory created.' )
216+ } catch {
217+ $WCMP.Warn (' Could not create the specified path "' + $WCMP.Config.Path + ' ". Falling back to current directory.' )
218+ $WCMP.Config.Path = $WCMP.DefaultConfig.Path
219+ }
220+ } elseif (! ($WCMP.Config.Path )) {
212221 $WCMP.Config.Path = $WCMP.DefaultConfig.Path
213222}
214223
You can’t perform that action at this time.
0 commit comments