revert to powershell executable

This commit is contained in:
Fran Jurmanović
2025-08-17 16:53:44 +02:00
parent f660511b63
commit a70d923a6a

View File

@@ -35,15 +35,9 @@ func NewSteamService(repository *repository.SteamCredentialsRepository, tfaManag
LogOutput: true, LogOutput: true,
} }
// Create a separate executor for SteamCMD that doesn't use PowerShell
steamCMDExecutor := &command.CommandExecutor{
ExePath: env.GetSteamCMDPath(),
LogOutput: true,
}
return &SteamService{ return &SteamService{
executor: baseExecutor, executor: baseExecutor,
interactiveExecutor: command.NewInteractiveCommandExecutor(steamCMDExecutor, tfaManager), interactiveExecutor: command.NewInteractiveCommandExecutor(baseExecutor, tfaManager),
repository: repository, repository: repository,
tfaManager: tfaManager, tfaManager: tfaManager,
pathValidator: security.NewPathValidator(), pathValidator: security.NewPathValidator(),
@@ -127,27 +121,36 @@ func (s *SteamService) InstallServer(ctx context.Context, installPath string, se
return fmt.Errorf("failed to get Steam credentials: %v", err) return fmt.Errorf("failed to get Steam credentials: %v", err)
} }
// Build SteamCMD command (no PowerShell args needed since we call SteamCMD directly) // Get SteamCMD path from environment variable
args := []string{ steamCMDPath := env.GetSteamCMDPath()
// Build SteamCMD command arguments
steamCMDArgs := []string{
"+force_install_dir", absPath, "+force_install_dir", absPath,
"+login", "+login",
} }
if creds != nil && creds.Username != "" { if creds != nil && creds.Username != "" {
args = append(args, creds.Username) steamCMDArgs = append(steamCMDArgs, creds.Username)
if creds.Password != "" { if creds.Password != "" {
args = append(args, creds.Password) steamCMDArgs = append(steamCMDArgs, creds.Password)
} }
} else { } else {
args = append(args, "anonymous") steamCMDArgs = append(steamCMDArgs, "anonymous")
} }
args = append(args, steamCMDArgs = append(steamCMDArgs,
"+app_update", ACCServerAppID, "+app_update", ACCServerAppID,
"validate", "validate",
"+quit", "+quit",
) )
// Build PowerShell arguments to execute SteamCMD directly
// This matches the format: powershell -nologo -noprofile c:\steamcmd\steamcmd.exe +args...
args := []string{"-nologo", "-noprofile"}
args = append(args, steamCMDPath)
args = append(args, steamCMDArgs...)
// Use interactive executor to handle potential 2FA prompts with timeout // Use interactive executor to handle potential 2FA prompts with timeout
logging.Info("Installing ACC server to %s...", absPath) logging.Info("Installing ACC server to %s...", absPath)