[repo] FabricaRelease: Rosea as a Fabrica app: the release and e2e pipelines, the Aula page's words and pictures, the version check, the APK signed in Custos, domi-rosea:// from the installer, the phone target
This commit is contained in:
@@ -103,6 +103,45 @@ describe('tauri.conf.json', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('domi-rosea://open, from the installer (fabrica-release.md F5)', () => {
|
||||
const windows = JSON.parse(readFileSync(join(SRC_TAURI, 'tauri.windows.conf.json'), 'utf8')) as {
|
||||
bundle: { windows?: { nsis?: { installerHooks?: string; installMode?: string } } };
|
||||
};
|
||||
const hooksPath = windows.bundle.windows?.nsis?.installerHooks ?? '';
|
||||
const hooks = existsSync(join(SRC_TAURI, hooksPath)) ? readFileSync(join(SRC_TAURI, hooksPath), 'utf8') : '';
|
||||
/** The NSIS statements of one macro, comments dropped. */
|
||||
const macro = (name: string): string[] =>
|
||||
(new RegExp(`!macro ${name}\\r?\\n([\\s\\S]*?)!macroend`).exec(hooks)?.[1] ?? '')
|
||||
.split(/\r?\n/)
|
||||
.map((l) => l.trim())
|
||||
.filter((l) => l !== '' && !l.startsWith(';'));
|
||||
|
||||
it('the Windows installer runs the hooks file, and installs for the current user only', () => {
|
||||
expect(hooksPath).toBe('./windows/hooks.nsh');
|
||||
expect(hooks).not.toBe('');
|
||||
const nsis = (conf.bundle as { windows?: { nsis?: { installMode?: string } } }).windows?.nsis;
|
||||
expect(nsis?.installMode).toBe('currentUser');
|
||||
});
|
||||
|
||||
it('registers exactly the domi-rosea scheme under HKCU, opening the installed exe with the address', () => {
|
||||
expect(macro('NSIS_HOOK_POSTINSTALL')).toEqual([
|
||||
'WriteRegStr HKCU "Software\\Classes\\domi-rosea" "" "URL:Rosea Domi"',
|
||||
'WriteRegStr HKCU "Software\\Classes\\domi-rosea" "URL Protocol" ""',
|
||||
`WriteRegStr HKCU "Software\\Classes\\domi-rosea\\DefaultIcon" "" '"$INSTDIR\\\${MAINBINARYNAME}.exe",0'`,
|
||||
`WriteRegStr HKCU "Software\\Classes\\domi-rosea\\shell\\open\\command" "" '"$INSTDIR\\\${MAINBINARYNAME}.exe" "%1"'`
|
||||
]);
|
||||
});
|
||||
|
||||
it('the uninstaller removes that key and nothing else', () => {
|
||||
expect(macro('NSIS_HOOK_POSTUNINSTALL')).toEqual(['DeleteRegKey HKCU "Software\\Classes\\domi-rosea"']);
|
||||
});
|
||||
|
||||
it('writes nowhere else: no machine-wide key, no other hook', () => {
|
||||
expect(hooks).not.toMatch(/HKLM|HKCR|HKEY_/);
|
||||
expect([...hooks.matchAll(/!macro (\w+)/g)].map((m) => m[1])).toEqual(['NSIS_HOOK_POSTINSTALL', 'NSIS_HOOK_POSTUNINSTALL']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the Rust side (D5)', () => {
|
||||
it('depends on tauri alone: no plugin, no SDK', () => {
|
||||
const cargo = readFileSync(join(SRC_TAURI, 'Cargo.toml'), 'utf8');
|
||||
|
||||
Reference in New Issue
Block a user