예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }