Skip to content

Installer: drop redundant -WindowStyle Hidden from the Windows launcher VBS#6284

Merged
danielhanchen merged 2 commits into
mainfrom
fix/launcher-av-heuristic-windowstyle
Jun 13, 2026
Merged

Installer: drop redundant -WindowStyle Hidden from the Windows launcher VBS#6284
danielhanchen merged 2 commits into
mainfrom
fix/launcher-av-heuristic-windowstyle

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

The Windows installer creates a desktop / Start Menu shortcut that launches Unsloth Studio windowlessly through a generated launch-studio.vbs:

Set shell = CreateObject("WScript.Shell")
cmd = "powershell -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File ""...launch-studio.ps1"""
shell.Run cmd, 0, False

The second argument to shell.Run is intWindowStyle = 0 (hidden), so WScript already starts the child windowless. The child -WindowStyle Hidden is therefore redundant. This drops it, which keeps the launcher hidden and the behaviour identical, and removes the "WScript spawns a hidden, ExecutionPolicy-Bypass PowerShell" token combination that antivirus heuristics weight. That shape was reported as a Kaspersky HEUR:Trojan.VBS.Agent false positive during install.

- cmd = "powershell -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File ""$launcherPs1"""
+ cmd = "powershell -NoProfile -ExecutionPolicy Bypass -File ""$launcherPs1"""

-ExecutionPolicy Bypass is kept on purpose: the locally generated, unsigned .ps1 must still run under the default Restricted machine policy.

Why this is a false positive (audit)

I scanned the exact launcher files the installer writes (the current baseline plus several hardening candidates) across Windows, macOS and Linux runners, and on VirusTotal:

Engine Result on the current launcher
Microsoft Defender, real-time + cloud, verified live each run with an EICAR positive control, static (3 passes) 0 detections
Microsoft Defender, actually launched 5 times (wscript to hidden PowerShell) 0 detections
ClamAV (Windows, Linux, macOS) clean
VirusTotal, ~70 engines including Kaspersky and Microsoft 0 / 60

Every engine is clean, both statically and at launch, confirmed across three independent Defender-live runs. The Kaspersky desktop detection is a transient heuristic / cloud-reputation false positive that does not reproduce in current engines; this change trims the heuristic footprint that produced it.

Tests

  • New tests/studio/install/test_launch_studio_launcher.py asserts the generated VBS no longer passes -WindowStyle Hidden, still stays windowless via shell.Run(cmd, 0, False), and keeps -ExecutionPolicy Bypass -File.
  • Existing tests/python/test_cross_platform_parity.py still passes.

Operational follow-up

Submitting the launcher to the Kaspersky and Microsoft false-positive / whitelist portals is recommended so the transient detection is cleared vendor-side as well.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

…er VBS

The desktop / Start Menu shortcut launches Studio through a generated
launch-studio.vbs that runs:

  shell.Run "powershell ... -WindowStyle Hidden -File launch-studio.ps1", 0, False

The second argument to shell.Run is intWindowStyle 0 (hidden), so WScript
already launches the child windowless. The child -WindowStyle Hidden is
therefore redundant: dropping it keeps the launcher hidden and behaviour
identical, while removing the WScript-spawns-hidden-ExecutionPolicy-Bypass
PowerShell token combination that antivirus heuristics weight. That shape was
reported as a Kaspersky HEUR:Trojan.VBS.Agent false positive during install.

Adds tests/studio/install/test_launch_studio_launcher.py to stop the flag from
being reintroduced and to assert the launcher stays windowless via
shell.Run(cmd, 0, False).
@danielhanchen danielhanchen force-pushed the fix/launcher-av-heuristic-windowstyle branch from 563bbd9 to 7841e7e Compare June 13, 2026 04:17
@danielhanchen danielhanchen merged commit 985792a into main Jun 13, 2026
27 of 28 checks passed
@danielhanchen danielhanchen deleted the fix/launcher-av-heuristic-windowstyle branch June 13, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants