Fix direct window launch when VBScript is disabled
The window now starts Luminary.ps1 through a hidden PowerShell process instead of relying on the VBS entry point, and the installer defaults to Luminary.cmd. Bump the beta to 0.5.1.
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "luminary",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "luminary",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"exifr": "^7.1.3",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "luminary",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ import {
|
||||
startImmichImport,
|
||||
} from './immich.mjs';
|
||||
|
||||
const VERSION = '0.5.0';
|
||||
const VERSION = '0.5.1';
|
||||
const COOKIE = 'lumen_session';
|
||||
|
||||
/** Self-only policy; must allow the wasm engines and React inline styles. */
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
* Versions shown in the About panel. APP_VERSION mirrors package.json; the
|
||||
* guide values are bumped when docs/user-guide/guide.html is republished.
|
||||
*/
|
||||
export const APP_VERSION = '0.5.0';
|
||||
export const APP_VERSION = '0.5.1';
|
||||
export const GUIDE_VERSION = '0.5';
|
||||
export const GUIDE_UPDATED = 'November 2026';
|
||||
|
||||
+10
-8
@@ -84,7 +84,7 @@ Output:
|
||||
|
||||
```
|
||||
<out>/
|
||||
Luminary-0.5.0-win-x64.zip the deliverable
|
||||
Luminary-0.5.1-win-x64.zip the deliverable
|
||||
stage/Luminary/ the unpacked bundle (kept for inspection)
|
||||
cache/node-v24.22.2-win-x64.exe pinned runtime, reused next time
|
||||
cache/SHASUMS256-v24.22.2.txt
|
||||
@@ -125,7 +125,7 @@ the context; the app's own `Dockerfile` is unaffected.
|
||||
Inno Setup 6 on any Windows machine (or a Windows CI runner):
|
||||
|
||||
```bat
|
||||
iscc /DAppVersion=0.5.0 /DLauncher=Luminary.vbs ^
|
||||
iscc /DAppVersion=0.5.1 /DLauncher=Luminary.cmd ^
|
||||
/DSourceDir="C:\builds\luminary\stage\Luminary" windows\installer.iss
|
||||
```
|
||||
|
||||
@@ -221,9 +221,11 @@ Evergreen installer. The exe adds roughly 70 MB to the zip, which is why it is
|
||||
opt-in rather than always shipped.
|
||||
|
||||
Double-clicking `LuminaryWindow.exe` directly is safe too. Without `--url` it
|
||||
starts the bundle launcher (`Luminary.cmd`, `Luminary.vbs` or `Luminary.exe`)
|
||||
and exits; the launcher then starts desktop mode and reopens the window with
|
||||
`--url`. If the exe is copied out of a complete bundle, it explains that it is
|
||||
starts the bundle launcher and exits; the launcher then starts desktop mode and
|
||||
reopens the window with `--url`. It uses `Luminary.exe` when the Go build ships
|
||||
one, otherwise it runs `Luminary.ps1` through a hidden PowerShell process. That
|
||||
avoids `Luminary.vbs` and Windows Script Host, which some machines disable by
|
||||
policy. If the exe is copied out of a complete bundle, it explains that it is
|
||||
only the window rather than showing a signed-out page.
|
||||
|
||||
`Luminary.cmd -Verify` checks the bundle. `Luminary.cmd -Repair` re-downloads
|
||||
@@ -248,9 +250,9 @@ Full behaviour, edge cases and the test checklist: [launcher/DESIGN.md](launcher
|
||||
|
||||
```bash
|
||||
cd <out>
|
||||
sha256sum Luminary-0.5.0-win-x64.zip
|
||||
unzip -t Luminary-0.5.0-win-x64.zip | tail -1
|
||||
unzip -l Luminary-0.5.0-win-x64.zip | grep -E 'node.exe|Luminary\.(exe|cmd|vbs)|app/server/index.mjs'
|
||||
sha256sum Luminary-0.5.1-win-x64.zip
|
||||
unzip -t Luminary-0.5.1-win-x64.zip | tail -1
|
||||
unzip -l Luminary-0.5.1-win-x64.zip | grep -E 'node.exe|Luminary\.(exe|cmd|vbs)|app/server/index.mjs'
|
||||
```
|
||||
|
||||
On Windows, the real test is the checklist in `launcher/DESIGN.md` §15,
|
||||
|
||||
@@ -40,9 +40,9 @@ second implementation to drift.
|
||||
|
||||
```
|
||||
repo=https://git.maple-street.net/bhursey/luminary.git
|
||||
tag=v0.5.0
|
||||
tag=v0.5.1
|
||||
commit=fb43ca8f1c2d… # full sha
|
||||
version=0.5.0 # package.json version, checked after fetch
|
||||
version=0.5.1 # package.json version, checked after fetch
|
||||
node=v24.22.2
|
||||
```
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
;
|
||||
; Build the bundle first: node windows/build.mjs
|
||||
; Then, from the output directory:
|
||||
; iscc /DAppVersion=0.5.0 /DSourceDir="<abs path to stage\Luminary>" \
|
||||
; iscc /DAppVersion=0.5.1 /DSourceDir="<abs path to stage\Luminary>" \
|
||||
; <repo>\windows\installer.iss
|
||||
;
|
||||
; The default SourceDir is relative to this script and only works when iscc is
|
||||
@@ -13,11 +13,12 @@
|
||||
; %LOCALAPPDATA%\Luminary\data and is kept on uninstall.
|
||||
|
||||
#ifndef AppVersion
|
||||
#define AppVersion "0.5.0"
|
||||
#define AppVersion "0.5.1"
|
||||
#endif
|
||||
#ifndef Launcher
|
||||
; Luminary.vbs for the PowerShell launcher build, Luminary.exe for the Go one.
|
||||
#define Launcher "Luminary.vbs"
|
||||
; Luminary.cmd works even when Windows Script Host is disabled; Luminary.exe
|
||||
; for the Go launcher build.
|
||||
#define Launcher "Luminary.cmd"
|
||||
#endif
|
||||
#ifndef SourceDir
|
||||
#define SourceDir "stage\Luminary"
|
||||
|
||||
@@ -279,7 +279,10 @@ uses `runtime.json`, and the browser window remains the fallback when the exe
|
||||
is absent or fails to start. A direct launch without `--url` forwards to the
|
||||
bundle launcher and exits immediately; that closes the old hole where
|
||||
double-clicking the window opened port 8787 directly and showed a login page
|
||||
(or a dead URL) because no desktop-mode server was running.
|
||||
(or a dead URL) because no desktop-mode server was running. The handoff prefers
|
||||
the Go `Luminary.exe`, then runs `Luminary.ps1` in a hidden PowerShell process;
|
||||
it does not use `Luminary.vbs`, because Windows Script Host can be disabled on
|
||||
managed machines even when the bundle is healthy.
|
||||
|
||||
## 12. Runtime resolution and repair
|
||||
|
||||
@@ -355,9 +358,10 @@ module, which needs the type-stripping runtime.
|
||||
bundle" message, not a missing-file crash.
|
||||
12. On a machine with Node 24 installed: delete `node.exe` → the launcher warns,
|
||||
starts on the system Node and `-Status` names that path; `-Stop` still works.
|
||||
13. Double-click `LuminaryWindow.exe` with no arguments → it exits, the bundle
|
||||
launcher starts desktop mode, and the reopened window is signed in; no login
|
||||
screen appears.
|
||||
13. Double-click `LuminaryWindow.exe` with no arguments on a machine where
|
||||
VBScript is disabled → it exits, the hidden PowerShell launcher starts
|
||||
desktop mode, and the reopened window is signed in; no login screen and no
|
||||
Windows Script Host error appear.
|
||||
14. On a machine with no Node: delete `node.exe` → the launch offers the 90 MB
|
||||
download; Yes installs and starts, No exits 3; `-Repair` works as well.
|
||||
15. Truncate `node.exe` (keep the first 100 kB) → `-Verify` reports `damaged`,
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<!-- WebView2Loader.dll is native; single-file must extract it at startup. -->
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
<Version>0.5.0</Version>
|
||||
<Version>0.5.1</Version>
|
||||
<AssemblyTitle>Luminary</AssemblyTitle>
|
||||
<Product>Luminary</Product>
|
||||
<Company>Maple Street</Company>
|
||||
|
||||
@@ -39,7 +39,7 @@ internal static class Program
|
||||
|
||||
MessageBox.Show(
|
||||
"LuminaryWindow.exe is only the app window.\n\n" +
|
||||
"Start Luminary.exe (or Luminary.cmd) from the Luminary folder instead.",
|
||||
"Start Luminary.cmd (or Luminary.vbs) from the Luminary folder instead.",
|
||||
"Luminary",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
@@ -63,25 +63,69 @@ internal static class Program
|
||||
// Environment.ProcessPath is the exe itself even in a single-file publish;
|
||||
// AppContext.BaseDirectory is only a fallback.
|
||||
var root = Path.GetDirectoryName(Environment.ProcessPath) ?? AppContext.BaseDirectory;
|
||||
foreach (var name in new[] { "Luminary.exe", "Luminary.vbs", "Luminary.cmd" })
|
||||
|
||||
// A Go build has one native launcher; use it when present.
|
||||
var native = Path.Combine(root, "Luminary.exe");
|
||||
if (File.Exists(native) && TryStart(native, root)) return true;
|
||||
|
||||
// Do not go through Luminary.vbs here. Windows Script Host can be
|
||||
// disabled by policy, which makes the window fail even though the
|
||||
// bundle is healthy. Run the PowerShell launcher hidden instead; it is
|
||||
// the same code Luminary.cmd uses and needs no console or .vbs handler.
|
||||
var script = Path.Combine(root, "Luminary.ps1");
|
||||
if (File.Exists(script))
|
||||
{
|
||||
var powershell = Path.Combine(
|
||||
Environment.SystemDirectory, "WindowsPowerShell", "v1.0", "powershell.exe");
|
||||
if (!File.Exists(powershell)) powershell = "powershell.exe";
|
||||
|
||||
try
|
||||
{
|
||||
var start = new ProcessStartInfo(powershell)
|
||||
{
|
||||
WorkingDirectory = root,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
};
|
||||
start.ArgumentList.Add("-NoProfile");
|
||||
start.ArgumentList.Add("-ExecutionPolicy");
|
||||
start.ArgumentList.Add("Bypass");
|
||||
start.ArgumentList.Add("-WindowStyle");
|
||||
start.ArgumentList.Add("Hidden");
|
||||
start.ArgumentList.Add("-File");
|
||||
start.ArgumentList.Add(script);
|
||||
Process.Start(start);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Fall through to the command entry point.
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var name in new[] { "Luminary.cmd", "Luminary.vbs" })
|
||||
{
|
||||
var launcher = Path.Combine(root, name);
|
||||
if (!File.Exists(launcher)) continue;
|
||||
if (File.Exists(launcher) && TryStart(launcher, root)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool TryStart(string launcher, string workingDirectory)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(launcher)
|
||||
{
|
||||
WorkingDirectory = root,
|
||||
WorkingDirectory = workingDirectory,
|
||||
UseShellExecute = true,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Try the next entry point before giving up.
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
e563cfe3be613ff3cea84030275c43fd363b4de4ef98fecf031382cbfc0d25c3 Luminary-0.5.0-win-x64.zip
|
||||
644c4e60451466e69d16860a9d1be509acc204168fb30bcd3f4f6b75ba24d922 Luminary-0.5.1-win-x64.zip
|
||||
|
||||
Reference in New Issue
Block a user