diff --git a/src/darwin/backend/ui.ps1 b/src/darwin/backend/ui.ps1 index 6fc3a4a..bea66cf 100644 --- a/src/darwin/backend/ui.ps1 +++ b/src/darwin/backend/ui.ps1 @@ -136,7 +136,7 @@ $btnInstall.Add_Click({ return } $form.Enabled = $false - $positions = Get-TerminalPositions $modules.Count + # $positions = Get-TerminalPositions $modules.Count foreach ($mod in $selected) { $index = [Array]::IndexOf($modules, $mod) if ($index -lt 0) { continue } @@ -147,10 +147,12 @@ $btnInstall.Add_Click({ [System.Windows.Forms.MessageBox]::Show("Modulo non trovato: $modPathRaw", "Errore", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error) continue } - $startCmdPosScript = Join-Path $ScriptDir "..\..\general\start-cmd-pos.ps1" + #$startCmdPosScript = Join-Path $ScriptDir "..\..\general\start-cmd-pos.ps1" + $startCmdScript = Join-Path $ScriptDir "..\..\general\start-cmd.ps1" $cmd = "cd /d $ScriptDir && install.bat `"" + $modPath + "`"" - $pos = $positions[$index] - powershell -ExecutionPolicy Bypass -File $startCmdPosScript -CommandLine $cmd -X $pos.X -Y $pos.Y -Width $pos.Width -Height $pos.Height + # $pos = $positions[$index] + # powershell -ExecutionPolicy Bypass -File $startCmdScript -Name "install $mod" -CommandLine $cmd -X $pos.X -Y $pos.Y -Width $pos.Width -Height $pos.Height + powershell -ExecutionPolicy Bypass -File $startCmdScript -Name "install $mod" -CommandLine $cmd } [System.Windows.Forms.MessageBox]::Show("Installazione avviata in nuove finestre terminale.", "Info", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information) $form.Enabled = $true @@ -164,7 +166,7 @@ $btnStart.Add_Click({ return } $form.Enabled = $false - $positions = Get-TerminalPositions $modules.Count + # $positions = Get-TerminalPositions $modules.Count FIX-ME: non funziona foreach ($mod in $selected) { $index = [Array]::IndexOf($modules, $mod) if ($index -lt 0) { continue } @@ -181,10 +183,12 @@ $btnStart.Add_Click({ [System.Windows.Forms.MessageBox]::Show("Modulo non trovato: $modPathRaw", "Errore", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error) continue } - $startCmdPosScript = Join-Path $ScriptDir "..\..\general\start-cmd-pos.ps1" + #$startCmdPosScript = Join-Path $ScriptDir "..\..\general\start-cmd-pos.ps1" + $startCmdScript = Join-Path $ScriptDir "..\..\general\start-cmd.ps1" $cmd = "cd /d $ScriptDir && $batName `"" + $modPath + "`"" - $pos = $positions[$index] - powershell -ExecutionPolicy Bypass -File $startCmdPosScript -CommandLine $cmd -X $pos.X -Y $pos.Y -Width $pos.Width -Height $pos.Height + # $pos = $positions[$index] + # powershell -ExecutionPolicy Bypass -File $startCmdPosScript -Name "start $mod" -CommandLine $cmd -X $pos.X -Y $pos.Y -Width $pos.Width -Height $pos.Height + powershell -ExecutionPolicy Bypass -File $startCmdScript -Name "start $mod" -CommandLine $cmd } [System.Windows.Forms.MessageBox]::Show("Avvio progetti in nuove finestre terminale.", "Info", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information) $form.Enabled = $true diff --git a/src/general/start-cmd.ps1 b/src/general/start-cmd.ps1 new file mode 100644 index 0000000..c25916c --- /dev/null +++ b/src/general/start-cmd.ps1 @@ -0,0 +1,16 @@ +param( + [Parameter(Mandatory=$true)] + [string]$CommandLine, + [Parameter(Mandatory=$false)] + [string]$Name +) + +# Prepara la command line con il titolo, se richiesto +if ($Name) { + $cmdline = "title $Name && $CommandLine" +} else { + $cmdline = $CommandLine +} + +# Avvia il processo cmd +Start-Process -FilePath "cmd.exe" -ArgumentList "/k $cmdline" -PassThru