Ejemplo n.º 1
0
        public void PassedConfigurationTakesFirstPrecendence()
        {
            // Setup
            var args = new ApplicationUpdaterConfig {
                Guid = new Guid("55E21349-157D-4ADC-83ED-B47AE1CDB7E4")
            };
            var config = ApplicationUpdaterConfigFactory.Create(args, null, GetType().Assembly);

            // Verify assert we pick up the correct GUID
            Assert.Equal(new Guid("55E21349-157D-4ADC-83ED-B47AE1CDB7E4"), config.Guid);
        }
Ejemplo n.º 2
0
        public void DetectExeUpdate()
        {
            var config = new ApplicationUpdaterConfig
            {
                FullFileName = @"D:\Apps\MyApp\MyApp.update.exe",
            };

            var updater = new ApplicationUpdater(config);

            var context = updater.GetUpdateContext();

            Assert.True(context.IsUpdate);
            Assert.Equal(PackageType.Executable, context.PackageType);
            Assert.Equal(@"D:\Apps\MyApp\MyApp.exe", context.UpdateDestination.FullName);
            Assert.Equal(@"D:\Apps\MyApp\MyApp.update.exe", context.UpdateSource.FullName);
        }
Ejemplo n.º 3
0
        public void DetectArchiveTemp()
        {
            var config = new ApplicationUpdaterConfig
            {
                FullFileName = Environment.ExpandEnvironmentVariables(@"%TEMP%\TempZip\MyApp.exe")
            };

            var updater = new ApplicationUpdater(config);

            var context = updater.GetUpdateContext();

            Assert.False(context.IsUpdate);
            Assert.False(context.IsDeployed);
            Assert.Equal(PackageType.Archive, context.PackageType);
            Assert.Equal(Environment.ExpandEnvironmentVariables(@"%LocalAppData%\Programs\MyApp"), context.UpdateDestination.FullName);
            Assert.Equal(Environment.ExpandEnvironmentVariables(@"%TEMP%\TempZip"), context.UpdateSource.FullName);
        }
Ejemplo n.º 4
0
        public void DetectArchiveUpdateWithCustomSuffix()
        {
            var config = new ApplicationUpdaterConfig
            {
                FullFileName = @"D:\Apps\MyApp\.tmp\MyApp.exe",
                UpdateSuffix = ".tmp"
            };

            var updater = new ApplicationUpdater(config);

            var context = updater.GetUpdateContext();

            Assert.True(context.IsUpdate);
            Assert.Equal(PackageType.Archive, context.PackageType);
            Assert.Equal(@"D:\Apps\MyApp", context.UpdateDestination.FullName);
            Assert.Equal(@"D:\Apps\MyApp\.tmp", context.UpdateSource.FullName);
        }
Ejemplo n.º 5
0
        public void DetectDownloadsFolder()
        {
            var config = new ApplicationUpdaterConfig
            {
                FullFileName = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\Downloads\MyApp.exe")
            };

            var updater = new ApplicationUpdater(config);

            var context = updater.GetUpdateContext();

            Assert.False(context.IsUpdate);
            Assert.False(context.IsDeployed);
            Assert.Equal(PackageType.Executable, context.PackageType);
            Assert.Equal(Environment.ExpandEnvironmentVariables(@"%LocalAppData%\Programs\MyApp"), context.UpdateDestination.FullName);
            Assert.Equal(Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\Downloads\MyApp.exe"), context.UpdateSource.FullName);
        }