Exemple #1
0
        public async void installUpdate(JObject updatePackage, InstallMode installMode, int minimumBackgroundDuration, IPromise promise)
        {
            await _codePush.UpdateManager.InstallPackageAsync(updatePackage, SettingsManager.IsPendingUpdate(null)).ConfigureAwait(false);

            var pendingHash = (string)updatePackage[CodePushConstants.PackageHashKey];

            SettingsManager.SavePendingUpdate(pendingHash, /* isLoading */ false);
            if (installMode == InstallMode.OnNextResume)
            {
                if (_minimumBackgroundListener == null)
                {
                    // Ensure we do not add the listener twice.
                    Action loadBundleAction = () =>
                    {
                        Context.RunOnNativeModulesQueueThread(async() =>
                        {
                            await LoadBundleAsync().ConfigureAwait(false);
                        });
                    };

                    _minimumBackgroundListener = new MinimumBackgroundListener(loadBundleAction, minimumBackgroundDuration);
                    _reactContext.AddLifecycleEventListener(_minimumBackgroundListener);
                }
                else
                {
                    _minimumBackgroundListener.MinimumBackgroundDuration = minimumBackgroundDuration;
                }
            }

            promise.Resolve("");
        }
Exemple #2
0
 public MoveInstallItemAssignment(IJobObserver parent, IItemObject item, InstallMode mode)
     : base(parent)
 {
     m_item  = item;
     m_mode  = mode;
     m_state = 0;
 }
 public Installer(InstallMode installMode)
 {
     InstallMode        = installMode;
     ServiceName        = ServiceBase.GetAppSettings("service-name");
     ServiceDisplayName = ServiceBase.GetAppSettings("service-displayname", ServiceName + " service");
     AccountName        = ServiceBase.GetAppSettings("service-account-name", "LOCAL SERVICE");
 }
        /// <summary>
        /// Install the application
        /// </summary>
        /// <param name="path">AppStore : App Id e.g :940347474, OutOfAppStore : itms-services full path</param>
        /// <param name="installMode"></param>
        public override async Task <bool> InstallApp(string path, InstallMode installMode)
        {
            if (installMode == InstallMode.AppStore)
            {
                // App Store URL.
                var appStoreLink = $"https://itunes.apple.com/us/app/apple-store/id{path}?mt=8";
                await Browser.OpenAsync(appStoreLink, BrowserLaunchMode.SystemPreferred);

                return(true);
            }
            else if (installMode == InstallMode.OutOfAppStore)
            {
                var supportUri = await Launcher.CanOpenAsync("itms-services://");

                if (supportUri)
                {
                    await Launcher.OpenAsync($"{path}");

                    return(true);
                }
                else
                {
                    var alertController = UIAlertController.Create("Alert", "Device does not support itms-services url prefix.", UIAlertControllerStyle.Alert);
                    alertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
                    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentedViewController?.PresentViewController(alertController, true, null);
                    return(false);
                }
            }

            return(false);
        }
Exemple #5
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallerInfo instance from a
 /// string representing the physical path to the root of the site
 /// </summary>
 /// <param name="sitePath">The physical path to the root of the site</param>
 /// <param name="mode">Install Mode.</param>
 /// -----------------------------------------------------------------------------
 public InstallerInfo(string sitePath, InstallMode mode)
 {
     Initialize();
     TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _PhysicalSitePath = sitePath;
     InstallMode       = mode;
 }
 public InstallerInfo(PackageInfo package, string sitePath)
 {
     _PhysicalSitePath  = sitePath;
     _TempInstallFolder = CommonLibrary.Common.Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _InstallMode       = InstallMode.UnInstall;
     package.AttachInstallerInfo(this);
 }
Exemple #7
0
 public static bool installPlugin(PluginBase plugin, InstallMode mode = 0)
 {
     if (!PluginBase.isValidPlugin(plugin))
     {
         return(false);
     }
     if (PluginBase.isInstalledPlugin(plugin))
     {
         return(false);
     }
     Log.i("ExtentCenter", string.Concat(new object[] { "install plugin... ", plugin.mName, ", install mode =", mode }));
     plugin.onInstalled(mode);
     plugin.mMetaInfo.isInstalled = true;
     PluginMetaStorage.updateMetaInfo(plugin);
     if ((mode == InstallMode.UserInstall) && (plugin.mProtocolPluginFlag != ((EPluginFlag)0)))
     {
         Account acc = AccountMgr.getCurAccount();
         acc.nPluginFlag = (uint)(((EPluginFlag)acc.nPluginFlag) & ~plugin.mProtocolPluginFlag);
         AccountMgr.updateAccount();
         //OpLogMgr.opModUserInfo(0x800, acc);
         ServiceCenter.sceneNewSync.doScene(7, syncScene.MM_NEWSYNC_SCENE_OTHER);
     }
     initializePlugin(plugin);
     return(true);
 }
 public InstallerInfo(Stream inputStream, string sitePath)
 {
     _TempInstallFolder = CommonLibrary.Common.Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _PhysicalSitePath  = sitePath;
     _InstallMode       = InstallMode.Install;
     ReadZipStream(inputStream, false);
 }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallerInfo instance from a 
 /// string representing the physical path to the root of the site
 /// </summary>
 /// <param name="sitePath">The physical path to the root of the site</param>
 /// <param name="mode">Install Mode.</param>
 /// -----------------------------------------------------------------------------
 public InstallerInfo(string sitePath, InstallMode mode)
 {
     Initialize();
     TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _PhysicalSitePath = sitePath;
     InstallMode = mode;
 }
 public InstallerInfo(PackageInfo package, string sitePath)
 {
     _PhysicalSitePath = sitePath;
     _TempInstallFolder = CommonLibrary.Common.Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _InstallMode = InstallMode.UnInstall;
     package.AttachInstallerInfo(this);
 }
 public MoveInstallItemAssignment(IJobObserver parent, IItemObject item, InstallMode mode)
     : base(parent)
 {
     m_item = item;
     m_mode = mode;
     m_state = 0;
 }
 public InstallerInfo(Stream inputStream, string sitePath)
 {
     _TempInstallFolder = CommonLibrary.Common.Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
     _PhysicalSitePath = sitePath;
     _InstallMode = InstallMode.Install;
     ReadZipStream(inputStream, false);
 }
        private CodeToolInfo(string _vsRoot, string _toolName, string _displayName, int _refreshDelay)
        {
            vsRoot        = _vsRoot;
            toolName      = _toolName;
            displayName   = _displayName;
            refreshDelay  = _refreshDelay;
            propertyPages = new List <PropertyPageInfo>();
            targets       = new List <TargetInfo>();
            installMode   = InstallMode.Install;

            // parse version parts of the visual studio root key
            int i = vsRoot.LastIndexOf('\\');

            if (i < 0)
            {
                vsVersionString = vsRoot;
            }
            else
            {
                vsVersionString = vsRoot.Substring(i + 1);
            }

            try
            {
                double vsMajor = 0;
                double vsMinor = 0;
                i = 0;
                // skip whitespace
                while (i < vsVersionString.Length && (" \t".IndexOf(vsVersionString[i]) >= 0))
                {
                    i++;
                }
                // parse main part
                while (i < vsVersionString.Length && Char.IsDigit(vsVersionString[i]))
                {
                    vsMajor = vsMajor * 10 + Char.GetNumericValue(vsVersionString, i);
                    i++;
                }
                while (i < vsVersionString.Length && (" \t.,".IndexOf(vsVersionString[i]) >= 0))
                {
                    i++;
                }
                // parse minor part
                while (i < vsVersionString.Length && Char.IsDigit(vsVersionString[i]))
                {
                    vsMinor = vsMinor / 10 + Char.GetNumericValue(vsVersionString, i) / 10;
                    i++;
                }
                vsVersion = vsMajor + vsMinor;
                if (vsVersion <= 0)
                {
                    vsVersion = 11.0;                  // assume latest version?
                }
                Common.Trace("Found version " + vsVersion.ToString() + " from: " + vsRoot);
            }
            catch
            {
                vsVersion = 0;
            }
        }
Exemple #14
0
 MsiProvideComponent(
     [In, MarshalAs(UnmanagedType.LPWStr)]        String Product
     , [In, MarshalAs(UnmanagedType.LPWStr)]      String Feature
     , [In, MarshalAs(UnmanagedType.LPWStr)]      String Component
     , [In, MarshalAs(UnmanagedType.U4)]          InstallMode Mode
     , [In, Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder Path
     , [In, Out, MarshalAs(UnmanagedType.U4)] ref int cchPathBuf
     );
        public InstallerProgress(InstallMode mode, string vsPath, string targetPath)
        {
            InitializeComponent();

            _mode = mode;
            _vsPath = vsPath;
            _targetPath = targetPath;
        }
Exemple #16
0
        public InstallerProgress(InstallMode mode, string vsPath, string targetPath)
        {
            InitializeComponent();

            _mode       = mode;
            _vsPath     = vsPath;
            _targetPath = targetPath;
        }
Exemple #17
0
        internal InstallerProgress(InstallMode mode, string vs9Path, string vs10Path, string targetPath)
        {
            InitializeComponent();

            _mode       = mode;
            _vs9Path    = vs9Path;
            _vs10Path   = vs10Path;
            _targetPath = targetPath;
        }
        internal InstallerProgress(InstallMode mode, string vs9Path, string vs10Path, string targetPath)
        {
            InitializeComponent();

            _mode = mode;
            _vs9Path = vs9Path;
            _vs10Path = vs10Path;
            _targetPath = targetPath;
        }
 public InstallerInfo(string tempFolder, string manifest, string sitePath)
 {
     _TempInstallFolder = tempFolder;
     _PhysicalSitePath = sitePath;
     _InstallMode = InstallMode.Install;
     if (!string.IsNullOrEmpty(manifest))
     {
         _ManifestFile = new InstallFile(manifest, this);
     }
 }
 public InstallerInfo(string tempFolder, string manifest, string sitePath)
 {
     _TempInstallFolder = tempFolder;
     _PhysicalSitePath  = sitePath;
     _InstallMode       = InstallMode.Install;
     if (!string.IsNullOrEmpty(manifest))
     {
         _ManifestFile = new InstallFile(manifest, this);
     }
 }
Exemple #21
0
        public static string ProvideComponent(string product, string feature,
                                              string component, InstallMode installMode)
        {
            int           pathLength = Installer.MaxPathLength;
            StringBuilder path       = new StringBuilder(pathLength);

            TR(MsiProvideComponent(product, feature, component,
                                   (UInt32)installMode, path, ref pathLength));
            return(path.ToString());
        }
Exemple #22
0
        public string ProvideQualified(
            string qualifier, InstallMode installMode, string product)
        {
            int           pathLength = Installer.MaxPathLength;
            StringBuilder path       = new StringBuilder(pathLength);

            TR(MsiProvideQualifiedComponentEx(m_code, qualifier,
                                              (UInt32)installMode, product, 0, 0, path, ref pathLength));
            return(path.ToString());
        }
Exemple #23
0
        static InstallAgent()
        {
            const int TRIES     = 10;
            const int WAIT_TIME = 5; // seconds
            string    tmp       = null;
            int       i;

            Trace.WriteLine("===> InstallAgent cctor");

            exeDir = new DirectoryInfo(
                Assembly.GetExecutingAssembly().Location
                ).Parent.FullName;

            // Branding's static ctor makes use of 'exeDir',
            // so it needs to be called after it's populated
            rootRegKeyName = Branding.GetString("BRANDING_installAgentRegKey");

            using (RegistryKey rootRK =
                       Registry.LocalMachine.CreateSubKey(rootRegKeyName))
            {
                for (i = 0; i < TRIES; ++i)
                {
                    tmp = (string)rootRK.GetValue("InstallMode");

                    if (!String.IsNullOrEmpty(tmp))
                    {
                        break;
                    }

                    Trace.WriteLine(
                        "Value 'InstallMode' does not exist. " +
                        "Try: " + i + "/" + TRIES
                        );
                    Trace.WriteLine("Sleeping for " + WAIT_TIME + " seconds");

                    Thread.Sleep(WAIT_TIME * 1000);
                }

                if (i == TRIES)
                {
                    throw new Exception("Unable to read 'InstallMode'");
                }

                installMode = (InstallMode)Enum.Parse(
                    typeof(InstallMode),
                    tmp,
                    true
                    );
            }

            // Just to kick off the static constructor
            // before we start messing with the VM
            VM.GetOtherDriverInstallingOnFirstRun();
            Trace.WriteLine("<=== InstallAgent cctor");
        }
Exemple #24
0
        public static string ProvideAssembly(string assemblyName,
                                             string appContext, InstallMode installMode, AssemblyInfo info)
        {
            int           pathLength = Installer.MaxPathLength;
            StringBuilder path       = new StringBuilder(pathLength);

            TR(MsiProvideAssembly(assemblyName, appContext,
                                  (UInt32)installMode, (UInt32)info,
                                  path, ref pathLength));
            return(path.ToString());
        }
Exemple #25
0
        /// <summary>
        /// Create intent to install the application / open google play store of the application
        /// </summary>
        /// <param name="path">
        /// If install from Play store, please fill in the package name in Play store.
        /// If install apk, please provide full local path of the apk file
        /// </param>
        /// <param name="installMode"></param>
        public override async Task <bool> InstallApp(string path, InstallMode installMode)
        {
            if (installMode == InstallMode.OutOfAppStore)
            {
                bool permissionGranted = true;
                do
                {
                    permissionGranted = await AskForRequiredPermission();
                } while (!permissionGranted);

                if (permissionGranted)
                {
                    Java.IO.File file = new Java.IO.File(path);

                    if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.N)
                    {
                        Android.Net.Uri apkUri = FileProvider.GetUriForFile(Android.App.Application.Context,
                                                                            this._fileProviderAuthorities, file);
                        Intent intent = new Intent(Intent.ActionInstallPackage);
                        intent.SetData(apkUri);
                        intent.AddFlags(ActivityFlags.GrantReadUriPermission);
                        intent.AddFlags(ActivityFlags.NewTask);
                        Android.App.Application.Context.StartActivity(intent);
                        return(true);
                    }
                    else
                    {
                        Intent intent = new Intent(Intent.ActionView);
                        intent.SetDataAndType(Android.Net.Uri.FromFile(file), "application/vnd.android.package-archive");
                        intent.AddFlags(ActivityFlags.NewTask);
                        Android.App.Application.Context.StartActivity(intent);
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else if (installMode == InstallMode.AppStore)
            {
                Intent intent = new Intent(Intent.ActionView);
                intent.SetData(Android.Net.Uri.Parse($"market://details?id={path}"));
                Android.App.Application.Context.StartActivity(intent);
                return(true);
            }
            else
            {
                //Unknown issue
                return(false);
            }
        }
Exemple #26
0
 public InstallCommand(
     ColoredTextWriter output,
     IFuse fuse)
     : base("install", "Install an external component")
 {
     _componentInstallers = new ComponentInstallers(fuse);
     _output  = output;
     _fuse    = fuse;
     _options = new OptionSet()
     {
         { "s|status", "Check install status of a package.", a => _mode = InstallMode.CheckStatus }
     };
 }
        public IInitializeTheHost Create(InstallMode installMode)
        {
            switch (installMode)
            {
            case InstallMode.Install:
            case InstallMode.Uninstall:
                return(new InstallInitialization(_installerFactory));

            case InstallMode.InstallAndStart:
                return(new InstallAndStartInitialization(_installerFactory, _serviceStarter));

            case InstallMode.NotSet:
            default:
                return(new RunInitialization(_serviceRunnerFactory));
            }
        }
Exemple #28
0
        public static void Run(string[] args)
        {
            var cli = new CommandlineArguments(args);

            InstallMode mode = InstallMode.Install;

            var runtimeInfo = Platform.New <IRuntimeInfo>();

            if (cli.GetValue <string>("mode") != null)
            {
                mode = (InstallMode)Enum.Parse(typeof(InstallMode), cli.GetValue <string>("mode"), true);
            }
            else
            {
                mode = runtimeInfo.IsApplicationInstalled(Context) ? InstallMode.Uninstall : InstallMode.Install;
            }

            Context.Properties.SetProperty("mode", mode);
            Context.Properties.SetProperty(NamingConstants.Silent, cli.HasOption(NamingConstants.Silent));

            if (!cli.HasOption(NamingConstants.Silent))
            {
                //run ui mode
                AppBuilder.Configure <App>()
                .UsePlatformDetect()
                .LogToTrace()
                .StartWithClassicDesktopLifetime(args);
            }
            else
            {
                // run cmd mode

                if (mode == InstallMode.Install)
                {
                    Context.Pipeline.Install(Context);
                }
                else if (mode == InstallMode.Uninstall)
                {
                    Context.Pipeline.Uninstall(Context);
                }
                else if (mode == InstallMode.Upgrade)
                {
                    Context.Pipeline.Upgrade(Context);
                }
            }
        }
Exemple #29
0
        /// <summary>
        /// Gets the full path to a Windows Installer component containing an assembly. This method prompts for a source and
        /// increments the usage count for the feature.
        /// </summary>
        /// <param name="assemblyName">Assembly name</param>
        /// <param name="appContext">Set to null for global assemblies. For private assemblies, set to the full path of the
        /// application configuration file (.cfg file) or executable file (.exe) of the application to which the assembly
        /// has been made private.</param>
        /// <param name="installMode">Installation mode; this can also include bits from <see cref="ReinstallModes"/></param>
        /// <param name="isWin32Assembly">True if this is a Win32 assembly, false if it is a .NET assembly</param>
        /// <returns>Path to the assembly</returns>
        /// <remarks><p>
        /// Win32 MSI API:
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovideassembly.asp">MsiProvideAssembly</a>
        /// </p></remarks>
        public static string ProvideAssembly(string assemblyName, string appContext, InstallMode installMode, bool isWin32Assembly)
        {
            StringBuilder pathBuf     = new StringBuilder(512);
            uint          pathBufSize = (uint)pathBuf.Capacity;
            uint          ret         = NativeMethods.MsiProvideAssembly(assemblyName, appContext, unchecked ((uint)installMode), (isWin32Assembly ? (uint)1 : 0), pathBuf, ref pathBufSize);

            if (ret == (uint)NativeMethods.Error.MORE_DATA)
            {
                pathBuf.Capacity = (int)++pathBufSize;
                ret = NativeMethods.MsiProvideAssembly(assemblyName, appContext, unchecked ((uint)installMode), (isWin32Assembly ? (uint)1 : 0), pathBuf, ref pathBufSize);
            }

            if (ret != 0)
            {
                throw InstallerException.ExceptionFromReturnCode(ret);
            }
            return(pathBuf.ToString());
        }
        private CodeToolInfo(string _vsRoot, string _toolName, string _displayName, int _refreshDelay)
        {
            vsRoot = _vsRoot;
            toolName = _toolName;
            displayName = _displayName;
            refreshDelay = _refreshDelay;
            propertyPages = new List<PropertyPageInfo>();
            targets = new List<TargetInfo>();
            installMode = InstallMode.Install;

            // parse version parts of the visual studio root key
            int i = vsRoot.LastIndexOf('\\');
            if (i < 0) vsVersionString = vsRoot;
            else vsVersionString = vsRoot.Substring(i + 1);

            try
            {
                double vsMajor = 0;
                double vsMinor = 0;
                i = 0;
                // skip whitespace
                while (i < vsVersionString.Length && (" \t".IndexOf(vsVersionString[i]) >= 0)) i++;
                // parse main part
                while (i < vsVersionString.Length && Char.IsDigit(vsVersionString[i]))
                {
                    vsMajor = vsMajor * 10 + Char.GetNumericValue(vsVersionString, i);
                    i++;
                }
                while (i < vsVersionString.Length && (" \t.,".IndexOf(vsVersionString[i]) >= 0)) i++;
                // parse minor part
                while (i < vsVersionString.Length && Char.IsDigit(vsVersionString[i]))
                {
                    vsMinor = vsMinor / 10 + Char.GetNumericValue(vsVersionString, i) / 10;
                    i++;
                }
                vsVersion = vsMajor + vsMinor;
                if (vsVersion <= 0) vsVersion = 11.0;  // assume latest version?
                Common.Trace("Found version " + vsVersion.ToString() + " from: " + vsRoot);
            }
            catch
            {
                vsVersion = 0;
            }
        }
Exemple #31
0
        public int AddEntry(EmbEntry embEntry, string _idx, InstallMode _installMode)
        {
            int idx = int.Parse(_idx);

            if (_installMode == InstallMode.MatchIndex)
            {
                if (idx <= (Entry.Count - 1))
                {
                    Entry[idx] = embEntry;
                    return(idx);
                }
                else
                {
                    //Add empty entries until idx is reached
                    while ((Entry.Count - 1) < (idx - 1))
                    {
                        Entry.Add(new EmbEntry()
                        {
                            Name = "dummy_" + (Entry.Count - 1).ToString(), Data = new List <byte>()
                        });
                    }

                    Entry.Add(embEntry);
                    return(Entry.Count - 1);
                }
            }
            else if (_installMode == InstallMode.MatchName)
            {
                for (int i = 0; i < Entry.Count; i++)
                {
                    if (Entry[i].Name == embEntry.Name)
                    {
                        Entry[i] = embEntry;
                        return(i);
                    }
                }

                Entry.Add(embEntry);
                return(Entry.Count - 1);
            }

            return(-1);
        }
        public InstallDialog(IPluginHost pluginHost, InstallMode mode, AaptBrandingCommandResult apkInfo )
            : base(pluginHost)
        {
            InitializeComponent ( );
            this.Mode = mode;
            this.ApkInformation = apkInfo;
            string name = string.Format ( "{0}{1}", !string.IsNullOrEmpty ( ApkInformation.Label ) ? ApkInformation.Label : ApkInformation.Package,
                string.IsNullOrEmpty ( ApkInformation.Version ) ? string.Empty : string.Format ( " {0}", ApkInformation.Version ) );
            this.title.Text = string.Format ( Properties.Resources.InstallDialogWelcomeTitle, name, Mode );
            information.Text = string.Format ( Properties.Resources.InstallDialogInformationLabel, name, mode );
            this.Text = string.Format ( "{0} {1}", mode, name );
            this.perform.Text = string.Format ( "&{0}", Mode.ToString ( ) );

            this.permissions.Visible = this.permissionsLabel.Visible = mode == InstallMode.Install;
            if ( mode == InstallMode.Install ) {
                this.permissions.DataSource = PluginHost.CommandRunner.GetLocalApkPermissions ( string.IsNullOrEmpty ( apkInfo.LocalApk ) ? apkInfo.DevicePath : apkInfo.LocalApk );
            }

            this.icon.Image = PluginHost.CommandRunner.GetLocalApkIconImage ( apkInfo.LocalApk );
        }
Exemple #33
0
        public InstallDialog(IPluginHost pluginHost, InstallMode mode, AaptBrandingCommandResult apkInfo) : base(pluginHost)
        {
            InitializeComponent( );
            this.Mode           = mode;
            this.ApkInformation = apkInfo;
            string name = string.Format("{0}{1}", !string.IsNullOrEmpty(ApkInformation.Label) ? ApkInformation.Label : ApkInformation.Package,
                                        string.IsNullOrEmpty(ApkInformation.Version) ? string.Empty : string.Format(" {0}", ApkInformation.Version));

            this.title.Text   = string.Format(Properties.Resources.InstallDialogWelcomeTitle, name, Mode);
            information.Text  = string.Format(Properties.Resources.InstallDialogInformationLabel, name, mode);
            this.Text         = string.Format("{0} {1}", mode, name);
            this.perform.Text = string.Format("&{0}", Mode.ToString( ));

            this.permissions.Visible = this.permissionsLabel.Visible = mode == InstallMode.Install;
            if (mode == InstallMode.Install)
            {
                this.permissions.DataSource = PluginHost.CommandRunner.GetLocalApkPermissions(string.IsNullOrEmpty(apkInfo.LocalApk) ? apkInfo.DevicePath : apkInfo.LocalApk);
            }

            this.icon.Image = PluginHost.CommandRunner.GetLocalApkIconImage(apkInfo.LocalApk);
        }
Exemple #34
0
        public Pages.IInstallerPage GetConfigurationPage(InstallMode mode)
        {
            switch (mode)
            {
            case InstallMode.Install: {
                if (Globals.InPortableMode == false)
                {
                    return(configPage);
                }
                else
                {
                    return(null);
                }
            }

            case InstallMode.Repair: {
                return(null);
            }
            }
            return(null);
        }
Exemple #35
0
        private string FormatInstallOptions(BehaviourOptions options)
        {
            if (!options.IsDefined)
            {
                return(Translate.Text("Undefined"));
            }
            InstallMode itemMode = options.ItemMode;

            if (itemMode == InstallMode.Undefined)
            {
                return(Translate.Text("Ask User"));
            }
            var builder = new StringBuilder(50);

            builder.Append(Translate.Text(itemMode.ToString()));
            if (itemMode == InstallMode.Merge)
            {
                builder.Append(" / ");
                builder.Append(Translate.Text(options.ItemMergeMode.ToString()));
            }
            return(builder.ToString());
        }
Exemple #36
0
        ProvideComponent(
            Guid Product
            , String Feature
            , Guid Component
            , InstallMode installMode = InstallMode.Default
            )
        {
            StringBuilder Path = new StringBuilder(1024);

            int PathBufferSize = Path.Capacity;

            Error error = MsiProvideComponent(
                Product.ToString("B")
                , Feature
                , Component.ToString("B")
                , installMode
                , Path
                , ref PathBufferSize
                );

            if (error == Error.MORE_DATA)
            {
                Path.Capacity = ++PathBufferSize;
                error         = MsiProvideComponent(
                    Product.ToString("B")
                    , Feature
                    , Component.ToString("B")
                    , installMode
                    , Path
                    , ref PathBufferSize
                    );
            }
            ;

            Marshal.ThrowExceptionForHR((int)error);
            return(Path.ToString());
        }
Exemple #37
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("No input specified Aboring!");
                return;
            }

            //Setting all the arguments
            for (int x = 0; x < args.Length; x += 2)
            {
                if (args[x] == "--udcd")
                {
                    udcd     = true;
                    udcdPath = args[x + 1];
                }
                if (args[x] == "--vpk")
                {
                    VPKPath = args[x + 1];
                }
                if (args[x] == "--tries")
                {
                    tries = int.Parse(args[x + 1]);
                }
                if (args[x] == "--ip")
                {
                    ftpOptions.IP = IPAddress.Parse(args[x + 1]);
                }
                if (args[x] == "--port")
                {
                    ftpOptions.PORT = int.Parse(args[x + 1]);
                }
                if (args[x] == "--command-port")
                {
                    ftpOptions.CMD_PORT = int.Parse(args[x + 1]);
                }
                if (args[x] == "--usb")
                {
                    transferOptions.useUSB = (args[x + 1] == "true");
                }
                if (args[x] == "--drive-letter")
                {
                    if (Regex.Matches(args[x + 1], "[A-Z]|[a-z]:").Count != 0)
                    {
                        transferOptions.driveLetter = args[x + 1];
                    }
                    else
                    {
                        Console.WriteLine("Incorrect drive letter given. Make sure it is just one letter and ends with a colon. For example: D:");
                        return;
                    }
                }
                if (args[x] == "--storage-type")
                {
                    storageType = parseStorageType(args[x + 1]);
                    if (storageType == StorageType.Unconfigured)
                    {
                        Console.WriteLine("Incorrect storage type given it should either be sd2vita or OFFICIAL remember it is case sensitive");
                        return;
                    }
                }
                if (args[x] == "--upload-dir")
                {
                    if (Directory.Exists(args[x + 1]))
                    {
                        UploadFolder = args[x + 1];
                    }
                    else
                    {
                        Console.WriteLine("Error uploader folder not found exiting....");
                        Console.WriteLine(UploadFolder);
                        Thread.Sleep(5000);
                        return;
                    }
                }
                if (args[x] == "--titleid")
                {
                    TitleID = args[x + 1];
                }
                if (args[x] == "--replace-install")
                {
                    Console.WriteLine("Setting install mode to replace install!");
                    installMode          = InstallMode.EXTRACT_REPLACE;
                    replaceInstallMethod = ReplaceInstallMethod.Full;
                    x--;
                }
                if (args[x] == "--extract")
                {
                    Console.WriteLine("Setting mode to extract!");
                    installMode = InstallMode.EXTRACT_PC_PROMOTE_VITA;
                    x--;
                }
                if (args[x] == "--complete-vita-install")
                {
                    installMode = InstallMode.PROMOTE_EXTRACT_VITA;
                    x--;
                }
                if (args[x] == "--pre-extract")
                {
                    Console.WriteLine("Set extract path to: " + args[x + 1]);
                    preExtracted = true;
                    ExtractPath  = args[x + 1];
                }
                if (args[x] == "--compare")
                {
                    replaceInstallMethod = ReplaceInstallMethod.Compare;
                    x--;
                }
                if (args[x] == "--partial")
                {
                    replaceInstallMethod = ReplaceInstallMethod.Partial;
                    x--;
                }
            }

            if (Directory.Exists("Uploader") && UploadFolder == "")
            {
                Directory.SetCurrentDirectory("Uploader");
            }
            else if (!(UploadFolder == ""))
            {
                Directory.SetCurrentDirectory(UploadFolder);
            }

            if (ftpOptions.IP == null || VPKPath == "")
            {
                Console.WriteLine("Invalid Arguments Aborting!");
                Thread.Sleep(5000);
                return;
            }

            if (!File.Exists(VPKPath) && !preExtracted)
            {
                //Checking if the input file specified exists
                Console.WriteLine("No file found. Check your input path and make sure to include the file extension.");
                Console.WriteLine(VPKPath);
                Thread.Sleep(5000);
                return;
            }

            if (ftpOptions.PORT == 0)
            {
                ftpOptions.PORT = 1337;
            }
            if (ftpOptions.CMD_PORT == 0)
            {
                ftpOptions.CMD_PORT = 1338;
            }

            closeAllApps();
            if (transferOptions.useUSB && (transferOptions.driveLetter == "" || transferOptions.driveLetter == null))
            {
                sendCommand("usb disable -");
                Thread.Sleep(100);
                Console.WriteLine("Getting list of all drives...");
                transferOptions.InitialDrives = Directory.GetLogicalDrives();
            }
            if (!transferOptions.useUSB)
            {
                ConfigureOptions();
                Console.WriteLine("Connecting to vita...");
                ftpSession.FileTransferProgress += new FileTransferProgressEventHandler(ProgressChanged);
                ftpSession.Open(sessionOptions);
                Console.WriteLine("Connected!");
            }
            if (installMode == InstallMode.EXTRACT_PC_PROMOTE_VITA || installMode == InstallMode.EXTRACT_REPLACE)
            {
                if (!preExtracted)
                {
                    ExtractVPK();
                }
            }

            if (transferOptions.useUSB)
            {
                LoadUSB();
                if (transferOptions.driveLetter == "" || transferOptions.driveLetter == null)
                {
                    while (Enumerable.SequenceEqual(transferOptions.InitialDrives, Directory.GetLogicalDrives()) && Directory.GetLogicalDrives().Length <= transferOptions.InitialDrives.Length)
                    {
                        Thread.Sleep(1);
                    }
                    transferOptions.driveLetter = GetNewDriveLetter();
                    if (transferOptions.driveLetter == "" || transferOptions.driveLetter == null)
                    {
                        Console.WriteLine("Error new drive not found! Enter one manually! For example: E:");
                        transferOptions.driveLetter = Console.ReadLine();
                    }
                }
                else
                {
                    while (!Directory.Exists(transferOptions.driveLetter + "\\data"))
                    {
                        Thread.Sleep(1);
                    }
                }

                if (installMode == InstallMode.EXTRACT_REPLACE)
                {
                    if (Directory.Exists(transferOptions.driveLetter + "/app/" + TitleID))
                    {
                        goto EXT_REP;
                    }
                    else
                    {
                        Console.WriteLine("Error app not previously installed changing to install mode!\n");
                        installMode = InstallMode.EXTRACT_PC_PROMOTE_VITA;
                    }
                }

                if (installMode == InstallMode.EXTRACT_PC_PROMOTE_VITA)
                {
                    CopyAll(new DirectoryInfo(ExtractPath), new DirectoryInfo(transferOptions.driveLetter + pkgTempFolder));
                    disableUSB();
                    sendCommand("ext_vpk ux0:" + pkgTempFolder);
                    if (TitleID != "NULL")
                    {
                        launchApp(TitleID);
                    }
                }

                if (installMode == InstallMode.PROMOTE_EXTRACT_VITA)
                {
                    File.Copy(VPKPath, transferOptions.driveLetter + "/data/sent.vpk", true);
                    disableUSB();
                    sendCommand("vpk " + SendPath);
                    if (TitleID != "NULL")
                    {
                        launchApp(TitleID);
                    }
                }
                Thread.Sleep(100);
                goto EXIT;
            }
            else
            {
                if (installMode == InstallMode.EXTRACT_REPLACE)
                {
                    if (ftpSession.FileExists("ux0:/app/" + TitleID))
                    {
                        goto EXT_REP;
                    }
                    else
                    {
                        Console.WriteLine("Error app not previously installed changing to install mode!\n");
                        installMode = InstallMode.EXTRACT_PC_PROMOTE_VITA;
                    }
                }

                if (installMode == InstallMode.EXTRACT_PC_PROMOTE_VITA)
                {
                    ftpUploadDirectory(ExtractPath, "ux0:" + pkgTempFolder);
                    sendCommand("ext_vpk ux0:" + pkgTempFolder);
                    if (TitleID != "NULL")
                    {
                        launchApp(TitleID);
                    }
                }
                if (installMode == InstallMode.PROMOTE_EXTRACT_VITA)
                {
                    ftpUploadFile(VPKPath, SendPath);
                    sendCommand("vpk " + SendPath);
                }
            }

EXT_REP:
            if (transferOptions.useUSB)
            {
                if (replaceInstallMethod.Equals(ReplaceInstallMethod.Partial))
                {
                    if (Directory.Exists(ExtractPath + "/Media"))
                    {
                        if (Directory.Exists(transferOptions.driveLetter + "/app/" + TitleID + "/Media"))
                        {
                            Directory.Delete(transferOptions.driveLetter + "/app/" + TitleID + "/Media", true);
                        }
                        CopyAll(new DirectoryInfo(ExtractPath + "/Media"), new DirectoryInfo(transferOptions.driveLetter + "/app/" + TitleID + "/Media"));
                    }
                    else
                    {
                        Console.WriteLine("This is not a unity app the partial install method is only suppourted with unity apps switching to compare");
                        replaceInstallMethod = ReplaceInstallMethod.Compare;
                    }
                }
                if (replaceInstallMethod.Equals(ReplaceInstallMethod.Compare))
                {
                    CopyDifferentFiles(new DirectoryInfo(ExtractPath), new DirectoryInfo(transferOptions.driveLetter + "/app/" + TitleID));
                }
                if (replaceInstallMethod.Equals(ReplaceInstallMethod.Full))
                {
                    Directory.Delete(transferOptions.driveLetter + "/app/" + TitleID, true);
                    CopyAll(new DirectoryInfo(ExtractPath), new DirectoryInfo(transferOptions.driveLetter + "/app/" + TitleID));
                }
                disableUSB();
                Thread.Sleep(100);
            }
            else
            {
                ftpSession.RemoveFiles("ux0:app/" + TitleID);
                ftpUploadDirectory(ExtractPath, "ux0:app/" + TitleID);
            }
            Thread.Sleep(200);
            for (int i = 0; i < tries; i++)
            {
                if (TitleID != "NULL")
                {
                    launchApp(TitleID);
                }
            }
            goto EXIT;


EXIT:
            if (!transferOptions.useUSB)
            {
                Console.WriteLine("Closing connection...");
                ftpSession.Close();
            }
            Console.WriteLine($"Exiting in {0} seconds", exitTime);
            Thread.Sleep(exitTime * 1000);
            Environment.Exit(0);
        }
    /// <summary>
    /// Gets the full path to a Windows Installer component containing an assembly. This method prompts for a source and
    /// increments the usage count for the feature.
    /// </summary>
    /// <param name="assemblyName">Assembly name</param>
    /// <param name="appContext">Set to null for global assemblies. For private assemblies, set to the full path of the
    /// application configuration file (.cfg file) or executable file (.exe) of the application to which the assembly
    /// has been made private.</param>
    /// <param name="installMode">Installation mode; this can also include bits from <see cref="ReinstallModes"/></param>
    /// <param name="isWin32Assembly">True if this is a Win32 assembly, false if it is a .NET assembly</param>
    /// <returns>Path to the assembly</returns>
    /// <remarks><p>
    /// Win32 MSI API:
    /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovideassembly.asp">MsiProvideAssembly</a>
    /// </p></remarks>
    public static string ProvideAssembly(string assemblyName, string appContext, InstallMode installMode, bool isWin32Assembly)
    {
        StringBuilder pathBuf = new StringBuilder(512);
        uint pathBufSize = (uint) pathBuf.Capacity;
        uint ret = NativeMethods.MsiProvideAssembly(assemblyName, appContext, unchecked ((uint) installMode), (isWin32Assembly ? (uint) 1 : 0), pathBuf, ref pathBufSize);
        if (ret == (uint) NativeMethods.Error.MORE_DATA)
        {
            pathBuf.Capacity = (int) ++pathBufSize;
            ret = NativeMethods.MsiProvideAssembly(assemblyName, appContext, unchecked ((uint) installMode), (isWin32Assembly ? (uint) 1 : 0), pathBuf, ref pathBufSize);
        }

        if (ret != 0)
        {
            throw InstallerException.ExceptionFromReturnCode(ret);
        }
        return pathBuf.ToString();
    }
    /// <summary>
    /// Gets the full component path for a qualified component that is published by a product and
    /// performs any necessary installation. This method prompts for source if necessary and increments
    /// the usage count for the feature.
    /// </summary>
    /// <param name="component">Specifies the component ID for the requested component. This may not be the
    /// GUID for the component itself but rather a server that provides the correct functionality, as in the
    /// ComponentId column of the PublishComponent table.</param>
    /// <param name="qualifier">Specifies a qualifier into a list of advertising components (from PublishComponent Table).</param>
    /// <param name="installMode">Installation mode; this can also include bits from <see cref="ReinstallModes"/></param>
    /// <param name="product">Optional; specifies the product to match that has published the qualified component.</param>
    /// <returns>Path to the component</returns>
    /// <remarks><p>
    /// Win32 MSI APIs:
    /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovidequalifiedcomponent.asp">MsiProvideQualifiedComponent</a>
    /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovidequalifiedcomponentex.asp">MsiProvideQualifiedComponentEx</a>
    /// </p></remarks>
    public static string ProvideQualifiedComponent(string component, string qualifier, InstallMode installMode, string product)
    {
        StringBuilder pathBuf = new StringBuilder(512);
        uint pathBufSize = (uint) pathBuf.Capacity;
        uint ret = NativeMethods.MsiProvideQualifiedComponentEx(component, qualifier, unchecked((uint)installMode), product, 0, 0, pathBuf, ref pathBufSize);
        if (ret == (uint) NativeMethods.Error.MORE_DATA)
        {
            pathBuf.Capacity = (int) ++pathBufSize;
            ret = NativeMethods.MsiProvideQualifiedComponentEx(component, qualifier, unchecked((uint)installMode), product, 0, 0, pathBuf, ref pathBufSize);
        }

        if (ret != 0)
        {
            throw InstallerException.ExceptionFromReturnCode(ret);
        }
        return pathBuf.ToString();
    }
 /// <summary>
 /// increments the usage count for a particular feature and returns the installation state for
 /// that feature. This method should be used to indicate an application's intent to use a feature.
 /// </summary>
 /// <param name="productCode">The product code of the product.</param>
 /// <param name="feature">The feature to be used.</param>
 /// <param name="installMode">Must have the value <see cref="InstallMode.NoDetection"/>.</param>
 /// <returns>The installed state of the feature.</returns>
 /// <remarks><p>
 /// The UseFeature method should only be used on features known to be published. The application
 /// should determine the status of the feature by calling either the FeatureState method or
 /// Features method.
 /// </p><p>
 /// Win32 MSI APIs:
 /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiusefeature.asp">MsiUseFeature</a>,
 /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiusefeatureex.asp">MsiUseFeatureEx</a>
 /// </p></remarks>
 public static InstallState UseFeature(string productCode, string feature, InstallMode installMode)
 {
     int installState = NativeMethods.MsiUseFeatureEx(productCode, feature, unchecked ((uint) installMode), 0);
     return (InstallState) installState;
 }
 public Pages.IInstallerPage GetConfigurationPage(InstallMode mode)
 {
     switch (mode) {
         case InstallMode.Install: {
                 if (Globals.InPortableMode == false) {
                     return configPage;
                 } else {
                     return null;
                 }
             }
         case InstallMode.Repair: {
                 return null;
             }
     }
     return null;
 }
Exemple #42
0
        /// <summary>
        /// Gets the full component path for a qualified component that is published by a product and
        /// performs any necessary installation. This method prompts for source if necessary and increments
        /// the usage count for the feature.
        /// </summary>
        /// <param name="component">Specifies the component ID for the requested component. This may not be the
        /// GUID for the component itself but rather a server that provides the correct functionality, as in the
        /// ComponentId column of the PublishComponent table.</param>
        /// <param name="qualifier">Specifies a qualifier into a list of advertising components (from PublishComponent Table).</param>
        /// <param name="installMode">Installation mode; this can also include bits from <see cref="ReinstallModes"/></param>
        /// <param name="product">Optional; specifies the product to match that has published the qualified component.</param>
        /// <returns>Path to the component</returns>
        /// <remarks><p>
        /// Win32 MSI APIs:
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovidequalifiedcomponent.asp">MsiProvideQualifiedComponent</a>
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiprovidequalifiedcomponentex.asp">MsiProvideQualifiedComponentEx</a>
        /// </p></remarks>
        public static string ProvideQualifiedComponent(string component, string qualifier, InstallMode installMode, string product)
        {
            StringBuilder pathBuf     = new StringBuilder(512);
            uint          pathBufSize = (uint)pathBuf.Capacity;
            uint          ret         = NativeMethods.MsiProvideQualifiedComponentEx(component, qualifier, unchecked ((uint)installMode), product, 0, 0, pathBuf, ref pathBufSize);

            if (ret == (uint)NativeMethods.Error.MORE_DATA)
            {
                pathBuf.Capacity = (int)++pathBufSize;
                ret = NativeMethods.MsiProvideQualifiedComponentEx(component, qualifier, unchecked ((uint)installMode), product, 0, 0, pathBuf, ref pathBufSize);
            }

            if (ret != 0)
            {
                throw InstallerException.ExceptionFromReturnCode(ret);
            }
            return(pathBuf.ToString());
        }
Exemple #43
0
        /// <summary>
        /// increments the usage count for a particular feature and returns the installation state for
        /// that feature. This method should be used to indicate an application's intent to use a feature.
        /// </summary>
        /// <param name="productCode">The product code of the product.</param>
        /// <param name="feature">The feature to be used.</param>
        /// <param name="installMode">Must have the value <see cref="InstallMode.NoDetection"/>.</param>
        /// <returns>The installed state of the feature.</returns>
        /// <remarks><p>
        /// The UseFeature method should only be used on features known to be published. The application
        /// should determine the status of the feature by calling either the FeatureState method or
        /// Features method.
        /// </p><p>
        /// Win32 MSI APIs:
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiusefeature.asp">MsiUseFeature</a>,
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiusefeatureex.asp">MsiUseFeatureEx</a>
        /// </p></remarks>
        public static InstallState UseFeature(string productCode, string feature, InstallMode installMode)
        {
            int installState = NativeMethods.MsiUseFeatureEx(productCode, feature, unchecked ((uint)installMode), 0);

            return((InstallState)installState);
        }
 public InstallerInfo(string sitePath, InstallMode mode)
 {
     _PhysicalSitePath = sitePath;
     _InstallMode = mode;
 }
Exemple #45
0
 public InstallItemAction(IItemObject item, InstallMode mode)
     : base(item)
 {
     this.Mode = mode;
 }
Exemple #46
0
        static void Main( string[] arguments )
        {
            using ( Stream stream = typeof ( Program ).Assembly.GetManifestResourceStream ( "DroidExplorer.Bootstrapper.DroidExplorer.Bootstrapper.log4net" ) ) {
                XmlConfigurator.Configure ( stream );
            }

            Arguments args = new Arguments ( arguments );

            if ( args.Contains ( "l", "log" ) ) {
                Logger.Level = log4net.Core.Level.All;
            } else {
                Logger.Level = log4net.Core.Level.All;
            }

            Logger.LogInfo ( typeof ( Program ), "System Info: {0} {1}", Environment.OSVersion.VersionString, Program.ApplicationArchitecture );
            Logger.LogDebug ( typeof ( Program ), "Starting setup with arguments: {0}", string.Join ( ",", arguments ) );

            /*Logger.LogDebug ( typeof ( Program ), "Checking for Minimum .net version" );
            if ( Requirements.HasDotNet35SP1OrGreater ( ) ) {
                Logger.LogDebug ( typeof ( Program ), "At least .net version 3.5 SP 1 is installed." );
            } else {
                Logger.LogFatal ( typeof ( Program ), "The requirement of .net framework 3.5 SP 1 was not found." );
                if ( MessageBox.Show ( "Microsoft .NET Framework 3.5 SP 1 was not found on this machine.\nClick 'OK' to navigate to the Microsoft website to download, or click 'Cancel' to just exit.\n\nSetup will not continue.", "Missing .NET Framework 3.5 SP1", MessageBoxButtons.OKCancel, MessageBoxIcon.Error ) == DialogResult.OK ) {
                    Process proc = new Process ( );
                    ProcessStartInfo psi = new ProcessStartInfo ( "http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en" );
                    proc.StartInfo = psi;
                    proc.Start ( );
                }
                return;
            }*/

            if ( !Requirements.IsCorrectPlatform ( ) ) {
                Logger.LogFatal ( typeof ( Program ), "Installing on the wrong platform." );
                MessageBox.Show ( string.Format ( "You are attempting to install the {0} version of Droid Explorer which is not supported on this platform. Please download the correct installer for your platform ({1})", Program.ApplicationArchitecture.ToString ( ), Requirements.Is64Bit ( ) ? ArchitectureTypes.x64.ToString ( ) : ArchitectureTypes.x86.ToString ( ) ),
                    "Can not install", MessageBoxButtons.OK, MessageBoxIcon.Error );
                return;
            }

            if ( args.Contains ( "u", "uninstall", "x", "remove" ) ) {
                Mode = InstallMode.Uninstall;
                Logger.LogDebug ( typeof ( Program ), "Mode set to uninstall" );
            } else {
                if ( args.Contains ( "s", "sdk", "sdkonly" ) ) {
                    /*Mode = InstallMode.SdkOnly;
                    Logger.LogDebug ( typeof ( Program ), "Mode set to SDK Only" );*/
                    Logger.LogDebug ( typeof ( Program ), "Mode '{0}' is no longer supported." );
                } else {
                    Mode = InstallMode.Install;
                    Logger.LogDebug ( typeof ( Program ), "Mode set to install" );
                }
            }

            /*Application.SetUnhandledExceptionMode ( UnhandledExceptionMode.Automatic );
            Application.ThreadException += delegate ( object sender, System.Threading.ThreadExceptionEventArgs e ) {
                Logger.LogError ( typeof ( Program ), e.Exception.Message, e.Exception );
                if ( wizard != null && !wizard.IsDisposed ) {
                    wizard.Error ( e.Exception );
                }
            };*/

            Application.EnableVisualStyles ( );
            Application.SetCompatibleTextRenderingDefault ( false );
            Application.Run ( new WizardForm ( ) );
        }
Exemple #47
0
 public InstallItemActionReport(ILivingObject living, IItemObject item, InstallMode mode)
     : base(living, item)
 {
     this.Mode = mode;
 }
        public void installUpdate(JObject updatePackage, InstallMode installMode, int minimumBackgroundDuration, IPromise promise)
        {
            Action installUpdateAction = async () =>
            {
                await _codePush.UpdateManager.InstallPackage(updatePackage, SettingsManager.IsPendingUpdate(null));
                var pendingHash = (string)updatePackage[CodePushConstants.PackageHashKey];
                SettingsManager.SavePendingUpdate(pendingHash, /* isLoading */false);
                if (installMode == InstallMode.OnNextResume)
                {
                    if (_minimumBackgroundListener == null)
                    {
                        // Ensure we do not add the listener twice.
                        Action loadBundleAction = () =>
                        {
                            Context.RunOnNativeModulesQueueThread(async () =>
                            {
                                await LoadBundle();
                            });
                        };
                        
                        _minimumBackgroundListener = new MinimumBackgroundListener(loadBundleAction, minimumBackgroundDuration);
                        _reactContext.AddLifecycleEventListener(_minimumBackgroundListener);
                    }
                    else
                    {
                        _minimumBackgroundListener.MinimumBackgroundDuration = minimumBackgroundDuration;
                    }
                }

                promise.Resolve("");
            };

            Context.RunOnNativeModulesQueueThread(installUpdateAction);
        }