Tutorial: System.launchManifest

System.launchManifest

Launches an application using a manifest file and returns the manifest. It supports protocols http/s and fin/s, and also a local path.

Note: This API is Windows only.

Examples

This API can handle most manifest types. Some examples below.

Traditional

const manifest = await fin.System.launchManifest('https://demoappdirectory.openf.in/desktop/config/apps/OpenFin/HelloOpenFin/app.json');
console.log(manifest);

Platform

const manifest = await fin.System.launchManifest('https://openfin.github.io/platform-api-project-seed/public.json');
console.log(manifest);

Launching traditional manifest into a platform

const manifest = await fin.System.launchManifest('https://openfin.github.io/platform-api-project-seed/public.json?$$appManifestUrl=https://demoappdirectory.openf.in/desktop/config/apps/OpenFin/HelloOpenFin/app.json');
console.log(manifest);

Launching with RVM options

const manifest = await fin.System.launchManifest('https://openfin.github.io/platform-api-project-seed/public.json', { noUi: true, userAppConfigArgs: { abc: '123', xyz: '789' } });
console.log(manifest);

Local Path

const manifest =  await fin.System.launchManifest('file://c:\\path\\to\\manifest\\file.json');
console.log(manifest);

Launching with RVM 'subscribe' option

This option allows users to subscribe to app version resolver events when calling launchManifest with fallbackManifests specified.

fin.System.launchManifest('fins://system-apps/notifications/app.json', { subscribe: (launch) => { 
		launch.on('app-version-progress', (progress) => {
			console.log("Trying manifest " + progress.manifest)
		});
		
		launch.on('runtime-status', (status) => {
			console.log("Runtime status: " + JSON.stringify(status));
		});
		
		// RVM has successfully found the target runtime version
		launch.on('app-version-complete', (complete) => {
			console.log("Parent app " + complete.srcManifest + " resolved to " + complete.manifest);
			launch.removeAllListeners();
		});
		
		// RVM failed to find an available runtime version
		launch.on('app-version-error', (error) => {
			console.log("Failed to resolve " + error.srcManifest + " from the fallbackManifests");
			launch.removeAllListeners();  
		}); 
	}
});