@@ -119,6 +119,34 @@ if ($isUpdate) {
119119}
120120Write-Host " "
121121
122+ # =========================================================================
123+ # INSTALL FOLDER (ask first)
124+ # =========================================================================
125+
126+ $defaultDir = Join-Path $env: ProgramFiles " T3 Code"
127+ Write-Bot " First — where do you want T3 Code installed?"
128+ Write-Host " "
129+ Write-Host " [1] Default ($defaultDir )" - ForegroundColor Cyan
130+ Write-Host " [2] Current folder ($ ( $PWD.Path ) )" - ForegroundColor Cyan
131+ Write-Host " [3] Custom path" - ForegroundColor Cyan
132+ Write-Host " "
133+ $folderChoice = Read-Host " Your choice (1/2/3)"
134+ switch ($folderChoice ) {
135+ " 2" { $installDir = $PWD.Path }
136+ " 3" {
137+ $customPath = Read-Host " Enter full path"
138+ if ($customPath -and $customPath.Length -gt 2 ) {
139+ $installDir = $customPath
140+ } else {
141+ Write-Warn " Invalid path, using default"
142+ $installDir = $defaultDir
143+ }
144+ }
145+ default { $installDir = $defaultDir }
146+ }
147+ Write-Ok " Install folder: $installDir "
148+ Write-Host " "
149+
122150# =========================================================================
123151# PACKAGE MANAGER
124152# =========================================================================
@@ -458,33 +486,6 @@ try {
458486 Write-Host " "
459487
460488 if (Ask- YesNo " Download and install T3 Code v$ ( $latestVersion ) ?" ) {
461- # Ask for install folder
462- $defaultDir = Join-Path $env: ProgramFiles " T3 Code"
463- Write-Host " "
464- Write-Bot " Where do you want to install T3 Code?"
465- Write-Host " Default: $defaultDir " - ForegroundColor DarkGray
466- Write-Host " Current: $ ( $PWD.Path ) " - ForegroundColor DarkGray
467- Write-Host " "
468- Write-Host " [1] Default ($defaultDir )" - ForegroundColor Cyan
469- Write-Host " [2] Current folder ($ ( $PWD.Path ) )" - ForegroundColor Cyan
470- Write-Host " [3] Custom path" - ForegroundColor Cyan
471- Write-Host " "
472- $folderChoice = Read-Host " Your choice (1/2/3)"
473- switch ($folderChoice ) {
474- " 2" { $installDir = $PWD.Path }
475- " 3" {
476- $customPath = Read-Host " Enter full path"
477- if ($customPath -and (Test-Path (Split-Path $customPath - Parent) - ErrorAction SilentlyContinue)) {
478- $installDir = $customPath
479- } else {
480- Write-Warn " Invalid path, using default"
481- $installDir = $defaultDir
482- }
483- }
484- default { $installDir = $defaultDir }
485- }
486- Write-Host " "
487-
488489 $tempDir = Join-Path $env: TEMP " t3code-install"
489490 $msiPath = Join-Path $tempDir $msiName
490491 if (-not (Test-Path $tempDir )) { New-Item - ItemType Directory - Path $tempDir - Force | Out-Null }
0 commit comments