public bool LaunchApp(string packageUri, string instanceId)
        {
            Logger.Debug("Launching application...");

            string resolvedPackageUri;
            var    package = ApplicationPackageResolver.Load(packageUri, (p) => p, out resolvedPackageUri);

            if (package == null)
            {
                throw new Exception("Could not resolve pacakge from " + packageUri);
            }

            var appId   = package.Manifest.Id;
            var appType = package.Manifest.Type;

            Logger.Info(string.Format("Launching {0} application {1} ...", appType, appId));

            if (instanceId == null)
            {
                instanceId = Guid.NewGuid().ToString();
            }

            var environment  = Application.Metadata.Environment;
            var exePath      = Assembly.GetEntryAssembly().Location;
            var isStandalone = Application.Metadata.IsStandalone;
            var args         = ParagonCommandLineParser.CreateCommandLine(environment, resolvedPackageUri, appType, appId, instanceId, isStandalone);
            var process      = Process.Start(new ProcessStartInfo(exePath, args)
            {
                ErrorDialog = false
            });

            return(process != null);
        }
        public IApplicationPackage GetApplicationPackage()
        {
            string resolvedUri;

            if (_package == null)
            {
                var package = ApplicationPackageResolver.Load(StartData, PackageSignatureVerifier, out resolvedUri);
                if (package == null)
                {
                    throw new Exception("Invalid start data");
                }

                _package = package;
                Id       = package.Manifest.Id;
            }
            return(_package);
        }