| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestInstallerCommandLineUsesVisibleUpdateModeAndLeavesDFlagLast(t *testing.T) { |
| 9 | got := installerCommandLine(`C:\Temp\Reasonix Installer.exe`, `D:\Tools\Reasonix App`) |
| 10 | want := `"C:\Temp\Reasonix Installer.exe" /REASONIXUPDATE=1 /REASONIXSTAGE=1 /D=D:\Tools\Reasonix App` |
| 11 | if got != want { |
| 12 | t.Fatalf("installerCommandLine = %q, want %q", got, want) |
| 13 | } |
| 14 | if strings.Contains(got, " /S") { |
| 15 | t.Fatalf("auto-update must expose progress instead of using silent mode, got %q", got) |
| 16 | } |
| 17 | if !strings.HasSuffix(got, `/D=D:\Tools\Reasonix App`) { |
| 18 | t.Fatalf("/D= must be the final unquoted NSIS token, got %q", got) |
| 19 | } |
| 20 | if !strings.Contains(got, " /REASONIXSTAGE=1") { |
| 21 | t.Fatalf("auto-update must extract away from the live install, got %q", got) |
| 22 | } |
| 23 | } |
| 24 |