Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }