private void AddLauncherUrlScheme(LauncherRegistrationData registrationData)
 {
     if (!RegistryHelper.TryRegisterUrlScheme(
             registrationData.UrlSchemeName, registrationData.RunnerPath))
     {
         throw new InvalidOperationException("Can't register launcher urlScheme");
     }
 }
 private void CreateShortcuts(LauncherRegistrationData registrationData)
 {
     try
     {
         //ShortcutHelper.CreateOrReplaceDesktopShortcut(registrationData.Name, registrationData.IconPath, registrationData.IconTarget, (string)null);
         //ShortcutHelper.CreateOrReplaceStartMenuShortcut("Innova Co. SARL", registrationData.Name, registrationData.IconPath, registrationData.IconTarget);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public void Register(LauncherRegistrationData registrationData, bool createShortcut)
        {
            RegisterInRegistry(registrationData);
            AddLauncherUrlScheme(registrationData);

            if (!createShortcut)
            {
                return;
            }

            CreateShortcuts(registrationData);
        }
 public void Unregister(LauncherRegistrationData unregistrationData)
 {
     try
     {
         RegistryHelper.DeleteUninstallInfo(unregistrationData.Key);
         //ShortcutHelper.DeleteDesktopShortcut(unregistrationData.Name);
         //ShortcutHelper.DeleteStartMenuShortcut("Innova Co. SARL", unregistrationData.Name);
         RegistryHelper.DeleteUrlScheme(unregistrationData.UrlSchemeName);
     }
     catch (Exception)
     {
         throw;
     }
 }
        private void RegisterInRegistry(LauncherRegistrationData registrationData)
        {
            bool flag = !IsRegistered(registrationData.Key);

            if (!RegistryHelper.TryRegisterUninstallInfo(registrationData.Key,
                                                         new RegistryUninstallInfo()
            {
                Version = registrationData.Version,
                SizeBytes = new long?(registrationData.SizeBytes),
                InstallationPath = registrationData.InstallationPath,
                IconPath = registrationData.IconPath,
                Name = registrationData.Name,
                InstallationDate = registrationData.InstallationDate,
                UninstallCommand = registrationData.UninstallCommand,
                Publisher = "Innova Co. SARL"
            }))
            {
                throw new InvalidOperationException(
                          $"Can't register launcher {registrationData.Key} in unninstall registry");
            }

            if (!RegistryHelper.TryRegisterLauncherSoftwareData(new RegisterLauncherSoftwareInfo {
                Publisher = "Innova Co. SARL",
                LauncherKey = registrationData.Key,
                Version = registrationData.Version,
                InstallationPath = registrationData.InstallationPath,
                InstallationDate = new DateTime?(registrationData.InstallationDate),
                OldGamesTaken = flag ? new bool?(false) : new bool?(),
                LastGamesInstallDirectory = registrationData.LastGamesInstallPath,
                LauncherRegion = registrationData.LauncherRegion
            }))
            {
                RegistryHelper.DeleteUninstallInfo(registrationData.Key);

                throw new InvalidOperationException(
                          $"Can't register launcher {registrationData.Key} in software registry");
            }
        }