Exemplo n.º 1
0
        public static void ImportProFile()
        {
            var manager   = QtVersionManager.The();
            var qtVersion = manager.GetDefaultVersion();
            var qtDir     = manager.GetInstallPath(qtVersion);

            if (qtDir == null)
            {
                Messages.DisplayErrorMessage(SR.GetString("CannotFindQMake"));
                return;
            }

            var info = new VersionInformation(qtDir);

            if (info.qtMajor < 5)
            {
                Messages.DisplayErrorMessage(SR.GetString("NoVS2015Support"));
                return;
            }

            if (VSPackage.dte != null)
            {
                var importer = new ProjectImporter(VSPackage.dte);
                importer.ImportProFile(qtVersion);
            }
        }
Exemplo n.º 2
0
        public static void ImportProFile()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var vm        = QtVersionManager.The();
            var qtVersion = vm.GetDefaultVersion();
            var qtDir     = vm.GetInstallPath(qtVersion);

            if (qtDir == null)
            {
                Messages.DisplayErrorMessage(SR.GetString("CannotFindQMake"));
                return;
            }
            var vi = VersionInformation.Get(qtDir);

            if (vi.qtMajor < 5)
            {
                Messages.DisplayErrorMessage(SR.GetString("NoVSSupport"));
                return;
            }
            if (QtVsToolsPackage.Instance.Dte != null)
            {
                var proFileImporter = new ProjectImporter(QtVsToolsPackage.Instance.Dte);
                proFileImporter.ImportProFile(qtVersion);
            }
        }
Exemplo n.º 3
0
        public void InitServerFolder(string serverFolder, string serverName)
        {
            // assemble complete update server path
            string completeFolder = serverFolder + Path.DirectorySeparatorChar + serverName;

            // generate new overview
            Overview overview = new Overview {
                Versions = new List <VersionNumber>()
            };
            VersionNumber baseVersion = new VersionNumber("0.0.0.1");

            overview.Versions.Add(baseVersion);
            DeSerializer.Serialize(overview, completeFolder + Path.DirectorySeparatorChar + "overview.xml");

            // create folder for base version
            Directory.CreateDirectory(completeFolder + Path.DirectorySeparatorChar + "0.0.0.1");

            // generate new info.xml for base version
            VersionInformation baseInfo  = new VersionInformation();
            VersionNumber      appliesTo = new VersionNumber("0.0.0.0");

            baseInfo.AppliesToVersion = appliesTo;
            baseInfo.ResultsInVersion = baseVersion;
            baseInfo.Files            = new List <UpdateFile>();
            DeSerializer.Serialize(baseInfo, completeFolder + Path.DirectorySeparatorChar + "0.0.0.1" + Path.DirectorySeparatorChar + "info.xml");
        }
Exemplo n.º 4
0
        public static ChocolateyLicense validate_license()
        {
            var license = LicenseValidation.validate();

            if (license.is_licensed_version())
            {
                try
                {
                    var licensedAssembly = Assembly.LoadFile(ApplicationParameters.LicensedAssemblyLocation);
                    license.AssemblyLoaded = true;
                    license.Assembly       = licensedAssembly;
                    license.Version        = VersionInformation.get_current_informational_version(licensedAssembly);
                    Type licensedComponent = licensedAssembly.GetType(ApplicationParameters.LicensedComponentRegistry, throwOnError: false, ignoreCase: true);
                    SimpleInjectorContainer.add_component_registry_class(licensedComponent);
                }
                catch (Exception ex)
                {
                    "chocolatey".Log().Error(
                        @"Error when attempting to load chocolatey licensed assembly. Ensure
 that chocolatey.licensed.dll exists at 
 '{0}'.
 Install with `choco install chocolatey.extension`.
 The error message itself may be helpful as well:{1} {2}".format_with(
                            ApplicationParameters.LicensedAssemblyLocation,
                            Environment.NewLine,
                            ex.Message
                            ));
                }
            }

            return(license);
        }
Exemplo n.º 5
0
        private static void set_environment_options(ChocolateyConfiguration config)
        {
            config.Information.PlatformType             = Platform.get_platform();
            config.Information.PlatformVersion          = Platform.get_version();
            config.Information.PlatformName             = Platform.get_name();
            config.Information.ChocolateyVersion        = VersionInformation.get_current_assembly_version();
            config.Information.ChocolateyProductVersion = VersionInformation.get_current_informational_version();
            config.Information.FullName = Assembly.GetExecutingAssembly().FullName;
            config.Information.Is64BitOperatingSystem = Environment.Is64BitOperatingSystem;
            config.Information.Is64BitProcess         = Environment.Is64BitProcess;
            config.Information.IsInteractive          = Environment.UserInteractive;
            config.Information.UserName            = System.Environment.UserName;
            config.Information.UserDomainName      = System.Environment.UserDomainName;
            config.Information.CurrentDirectory    = Environment.CurrentDirectory;
            config.Information.IsUserAdministrator = ProcessInformation.user_is_administrator();
            config.Information.IsUserSystemAccount = ProcessInformation.user_is_system();
            config.Information.IsUserRemoteDesktop = ProcessInformation.user_is_terminal_services();
            config.Information.IsUserRemote        = ProcessInformation.user_is_remote();
            config.Information.IsProcessElevated   = ProcessInformation.process_is_elevated();

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("https_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.Location))
            {
                config.Proxy.Location = Environment.GetEnvironmentVariable("https_proxy");
            }

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("http_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.Location))
            {
                config.Proxy.Location = Environment.GetEnvironmentVariable("http_proxy");
            }

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("no_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.BypassList))
            {
                config.Proxy.BypassList = Environment.GetEnvironmentVariable("no_proxy");
            }
        }
        public static IContainer RegisterAutoFac(string chocolateyGuiAssemblySimpleName, string licensedGuiAssemblyLocation)
        {
            var builder = new ContainerBuilder();

            builder.RegisterAssemblyModules(System.Reflection.Assembly.GetCallingAssembly());

            var license = License.validate_license();

            if (license.IsValid)
            {
                if (File.Exists(licensedGuiAssemblyLocation))
                {
                    var licensedGuiAssembly = AssemblyResolution.resolve_or_load_assembly(
                        chocolateyGuiAssemblySimpleName,
                        chocolatey.infrastructure.app.ApplicationParameters.OfficialChocolateyPublicKey,
                        licensedGuiAssemblyLocation);

                    if (licensedGuiAssembly != null)
                    {
                        license.AssemblyLoaded = true;
                        license.Assembly       = licensedGuiAssembly;
                        license.Version        = VersionInformation.get_current_informational_version(licensedGuiAssembly);

                        builder.RegisterAssemblyModules(licensedGuiAssembly.UnderlyingType);
                    }
                }
            }

            return(builder.Build());
        }
Exemplo n.º 7
0
        public static void ImportProFile()
        {
            QtVersionManager vm        = QtVersionManager.The();
            string           qtVersion = vm.GetDefaultVersion();
            string           qtDir     = vm.GetInstallPath(qtVersion);

            if (qtDir == null)
            {
                Messages.DisplayErrorMessage(SR.GetString("CannotFindQMake"));
                return;
            }
#if (VS2010 || VS2012 || VS2013)
            VersionInformation vi = new VersionInformation(qtDir);
            if (vi.qtMajor < 5)
            {
#if VS2010
                Messages.DisplayErrorMessage(SR.GetString("NoVS2010Support"));
#elif VS2012
                Messages.DisplayErrorMessage(SR.GetString("NoVS2012Support"));
#else
                Messages.DisplayErrorMessage(SR.GetString("NoVS2013Support"));
#endif
                return;
            }
#endif
            if (Connect._applicationObject != null)
            {
                ProjectImporter proFileImporter = new ProjectImporter(Connect._applicationObject);
                proFileImporter.ImportProFile(qtVersion);
            }
        }
        public async Task Invoke_DetailedVersionInformation_ReturnsVersion()
        {
            var expected = new VersionInformation(
                assemblyFileVersion: "1.1.1.1",
                assemblyInformationalVersion: "some arbitrary informational version",
                environmentName: "Production",
                runtimeFramework: ".NETCoreApp,Version=v1.0",
                startupTimeUtc: DateTimeOffset.UtcNow
                );

            _fixture.VersionService.GetVersionInformation().Returns(expected);

            var state = Substitute.For <IResourceCurrentState>();

            state.IsUp.Returns(true);
            _fixture.ResourceStateCollector.GetStates().Returns(new[] { state });
            _fixture.HttpRequest.Query.ContainsKey("detailed").Returns(true);

            var sut = _fixture.GetSut();

            await sut.Invoke(_fixture.HttpContext);

            var actual = _fixture.ReadDetailedResponse()?.VersionInformation;

            Assert.NotNull(actual);
            Assert.Equal(expected.AssemblyFileVersion, actual.AssemblyFileVersion);
            Assert.Equal(expected.AssemblyInformationalVersion, actual.AssemblyInformationalVersion);
            Assert.Equal(expected.EnvironmentName, actual.EnvironmentName);
            Assert.Equal(expected.MachineName, actual.MachineName);
            Assert.Equal(expected.RuntimeFramework, actual.RuntimeFramework);
            Assert.Equal(expected.StartupTimeUtc, actual.StartupTimeUtc);
        }
Exemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        HealthText.GetComponent <Text>().text  = "Health : " + PlayerScript.Health.ToString();       //adds health to a text base
        PointsText.GetComponent <Text>().text  = "Points : " + PlayerScript.Points.ToString();       //adds points to a text base
        VersionText.GetComponent <Text>().text = "Version : Alpha " + VersionInformation.ToString(); //adds version to a text base

        if (Input.GetButton("ChangeLog"))
        { // if C is pressed then activate changelog text
            ChangeLogText.GetComponent <Text>().text = "Version : Alpha " + VersionInformation.ToString() + " Niveau Tutoriel/menu,1 et 2, Changelog, optimisation, ";
        }//puts0 this on the screen (change log)
        else
        {
            ChangeLogText.GetComponent <Text>().text = " "; //puts0 this on the screen (change log)
        }

        if (Input.GetButtonDown("Cancel"))  //if escape button is pressed then quit
        {
            isPaused = !isPaused;
            if (!isPaused)
            {
                PauseUI.SetActive(true);
                MainPlayerUI.SetActive(false);
            }
            else
            {
                PauseUI.SetActive(false);
                MainPlayerUI.SetActive(true);
            }
            //          Application.Quit(); //kills the application
        }
    }
Exemplo n.º 10
0
        private static void set_environment_options(ChocolateyConfiguration config)
        {
            config.Information.PlatformType             = Platform.get_platform();
            config.Information.PlatformVersion          = Platform.get_version();
            config.Information.PlatformName             = Platform.get_name();
            config.Information.ChocolateyVersion        = VersionInformation.get_current_assembly_version();
            config.Information.ChocolateyProductVersion = VersionInformation.get_current_informational_version();
            config.Information.FullName = Assembly.GetExecutingAssembly().FullName;
            config.Information.Is64BitOperatingSystem = Environment.Is64BitOperatingSystem;
            config.Information.Is64BitProcess         = (IntPtr.Size == 8);
            config.Information.IsInteractive          = Environment.UserInteractive;
            config.Information.IsUserAdministrator    = ProcessInformation.user_is_administrator();
            config.Information.IsProcessElevated      = ProcessInformation.process_is_elevated();

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("https_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.Location))
            {
                config.Proxy.Location = Environment.GetEnvironmentVariable("https_proxy");
            }

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("http_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.Location))
            {
                config.Proxy.Location = Environment.GetEnvironmentVariable("http_proxy");
            }

            if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("no_proxy")) && string.IsNullOrWhiteSpace(config.Proxy.BypassList))
            {
                config.Proxy.BypassList = Environment.GetEnvironmentVariable("no_proxy");
            }
        }
Exemplo n.º 11
0
        void ReadEverythingFromExcel()
        {
            try
            {
                #region
                GridView1.DataSource       = PublicMethods.LoadDataFromExcel(sPath);
                GridView1.Columns[0].Width = Convert.ToInt32(GridView1.Width * 0.12);
                GridView1.Columns[1].Width = Convert.ToInt32(GridView1.Width * 0.12);
                GridView1.Columns[2].Width = Convert.ToInt32(GridView1.Width * 0.3);
                GridView1.Columns[3].Width = Convert.ToInt32(GridView1.Width * 0.3);
                GridView1.Columns[4].Width = Convert.ToInt32(GridView1.Width * 0.1);
                GridView1.Columns[5].Width = Convert.ToInt32(GridView1.Width * 0.1);

                currentDevicesList = new List <VersionInformation>();
                for (int i = 0; i < GridView1.RowCount; i++)
                {
                    if (GridView1[5, i].Value == null || GridView1[0, i].Value.ToString() == "")
                    {
                        continue;
                    }

                    VersionInformation vTmp = new VersionInformation();
                    vTmp.sModel        = GridView1[0, i].Value.ToString();
                    vTmp.sVersion      = GridView1[1, i].Value.ToString();
                    vTmp.sProduction   = GridView1[2, i].Value.ToString();
                    vTmp.sFirmwareName = GridView1[3, i].Value.ToString();
                    vTmp.sSerialId     = GridView1[5, i].Value.ToString();

                    currentDevicesList.Add(vTmp);
                }
                #endregion
            }
            catch { }
        }
 public void Init(Texture2D _logo, VersionInformation _versionInformation, string userGuidePath)
 {
     logo               = _logo;
     UserGuidePath      = userGuidePath;
     versionInformation = _versionInformation;
     minSize            = maxSize = new Vector2(_logo ? _logo.width + 10 : 0, _logo ? _logo.height + 60 : 0);
 }
        public void GenerateFileLists(VersionInformation source, out IList <string> changedFiles, out IList <string> deletedFiles)
        {
            IList <string> changed = new List <string>();
            IList <string> deleted = new List <string>();
            StringBuilder  entryBuilder;

            foreach (UpdateFile file in source.Files.Where(file => file.UpdateOperation == UpdateOperation.ADD))
            {
                entryBuilder = new StringBuilder();
                entryBuilder.Append(GetBaseString(file.UpdateType));
                entryBuilder.Append(file.DestinationFolder);
                entryBuilder.Append(Path.DirectorySeparatorChar);
                entryBuilder.Append(file.Name);
                changed.Add(entryBuilder.ToString());
            }

            foreach (UpdateFile file in source.Files.Where(file => file.UpdateOperation == UpdateOperation.DEL))
            {
                entryBuilder = new StringBuilder();
                entryBuilder.Append(GetBaseString(file.UpdateType));
                entryBuilder.Append(file.DestinationFolder);
                entryBuilder.Append(Path.DirectorySeparatorChar);
                entryBuilder.Append(file.Name);
                deleted.Add(entryBuilder.ToString());
            }
            changedFiles = changed;
            deletedFiles = deleted;
        }
Exemplo n.º 14
0
        public void KeepsVersion_WhenVersionPatternWithoutPlaceholderAndNoCommitsSinceVersionTaggedCommit()
        {
            const string Version = "1.2.3.0";

            VersionInformation result = this.testee.CalculateVersion(Version, null, 0, null);

            result.Should().Be(new VersionInformation(new Version(Version), "1.2.3", string.Empty));
        }
Exemplo n.º 15
0
        public VersionInformation GetVersionInformation()
        {
            string             textResponse = GetResponse(ApiVerb.Version);
            VersionInformation result       = new VersionInformation();

            VersionInformationParser.ParseTextForVersionInformation(textResponse, result);
            return(result);
        }
Exemplo n.º 16
0
 private static void set_environment_options(ChocolateyConfiguration config)
 {
     config.Information.PlatformType      = Platform.get_platform();
     config.Information.PlatformVersion   = Platform.get_version();
     config.Information.ChocolateyVersion = VersionInformation.get_current_assembly_version();
     config.Information.FullName          = Assembly.GetExecutingAssembly().FullName;
     config.Information.Is64Bit           = Environment.Is64BitOperatingSystem;
     config.Information.IsInteractive     = Environment.UserInteractive;
 }
Exemplo n.º 17
0
 /// <summary>
 /// </summary>
 /// <param name="mediator"></param>
 /// <param name="appConfigInstance"></param>
 /// <param name="versionInformation"></param>
 /// <param name="logger"></param>
 public GisQueryController(IMediator mediator, GisAppConfig appConfigInstance,
                           VersionInformation versionInformation,
                           ILogger <GisQueryController> logger)
 {
     _mediator           = mediator;
     _appConfigInstance  = appConfigInstance;
     _versionInformation = versionInformation;
     _logger             = logger;
 }
Exemplo n.º 18
0
        public void Init(Texture2D _logo, VersionInformation _versionInformation, string userGuidePath)
        {
            logo = _logo;
            UserGuidePath = userGuidePath;
            if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false)
                UserGuidePath = null;

            versionInformation = _versionInformation;
            minSize = maxSize = new Vector2(_logo ? _logo.width + 10 : 0, _logo ? _logo.height + 83 : 0);
        }
Exemplo n.º 19
0
        protected void ExchangeVersionInformation()
        {
            VersionInformation serverVersion = null;

            this.CallService(delegate()
            {
                TService channel = this.Channel;
                channel.ExchangeVersionInformation(LoadBalancerVersionInformation.LoadBalancerVersion, out serverVersion);
            });
            base.ServerVersion = serverVersion;
        }
Exemplo n.º 20
0
        public void ExchangeVersionInformation(VersionInformation clientVersion, out VersionInformation serverVersion)
        {
            VersionInformation serverVersionInfo = null;

            this.CallService(delegate()
            {
                TService channel = this.Channel;
                channel.ExchangeVersionInformation(clientVersion, out serverVersionInfo);
            });
            serverVersion = serverVersionInfo;
        }
Exemplo n.º 21
0
        public void Init(Texture2D _banner, VersionInformation _versionInformation, string userGuidePath)
        {
            //banner = _banner;
            //UserGuidePath = userGuidePath;

            //if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false)
            //    UserGuidePath = null;

            //versionInformation = _versionInformation;
            //minSize = maxSize = new Vector2(banner.width, 500);
        }
        public IList <string> GenerateFileOperationsList(VersionInformation source)
        {
            IList <string> result = new List <string>();

            foreach (UpdateFile file in source.Files)
            {
                result.Add(file.UpdateType.ToString() + " - " + file.UpdateOperation.ToString());
                result.Add(file.DestinationFolder + Path.DirectorySeparatorChar + file.Name);
            }
            return(result);
        }
Exemplo n.º 23
0
        public void Init(Texture2D _logo, VersionInformation _versionInformation, string userGuidePath)
        {
            logo          = _logo;
            UserGuidePath = userGuidePath;
            if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false)
            {
                UserGuidePath = null;
            }

            versionInformation = _versionInformation;
            minSize            = maxSize = new Vector2(_logo ? _logo.width + 10 : 0, _logo ? _logo.height + 83 : 0);
        }
Exemplo n.º 24
0
 private void deleteButton_Click(object sender, EventArgs e)
 {
     VersionInformation.Clear();
     QtVersionManager.The().ClearVersionCache();
     foreach (ListViewItem itm in listView.SelectedItems)
     {
         var name = itm.Text;
         versionManager.RemoveVersion(name);
         listView.Items.Remove(itm);
         SetupDefaultVersionComboBox(null);
     }
 }
Exemplo n.º 25
0
 private static void set_environment_options(ChocolateyConfiguration config)
 {
     config.Information.PlatformType             = Platform.get_platform();
     config.Information.PlatformVersion          = Platform.get_version();
     config.Information.PlatformName             = Platform.get_name();
     config.Information.ChocolateyVersion        = VersionInformation.get_current_assembly_version();
     config.Information.ChocolateyProductVersion = VersionInformation.get_current_informational_version();
     config.Information.FullName            = Assembly.GetExecutingAssembly().FullName;
     config.Information.Is64Bit             = Environment.Is64BitOperatingSystem;
     config.Information.IsInteractive       = Environment.UserInteractive;
     config.Information.IsUserAdministrator = ProcessInformation.user_is_administrator();
     config.Information.IsProcessElevated   = ProcessInformation.process_is_elevated();
 }
Exemplo n.º 26
0
        public static ChocolateyLicense validate_license()
        {
            var license = LicenseValidation.validate();

            if (license.is_licensed_version())
            {
                try
                {
                    var licensedAssembly = AssemblyResolution.resolve_or_load_assembly(ApplicationParameters.LicensedChocolateyAssemblySimpleName, ApplicationParameters.OfficialChocolateyPublicKey, ApplicationParameters.LicensedAssemblyLocation);

#if !FORCE_CHOCOLATEY_OFFICIAL_KEY
                    if (licensedAssembly == null)
                    {
                        licensedAssembly = AssemblyResolution.resolve_or_load_assembly(ApplicationParameters.LicensedChocolateyAssemblySimpleName, ApplicationParameters.UnofficialChocolateyPublicKey, ApplicationParameters.LicensedAssemblyLocation);
                    }
#endif
                    if (licensedAssembly == null)
                    {
                        throw new ApplicationException("Unable to load licensed assembly.");
                    }
                    license.AssemblyLoaded = true;
                    license.Assembly       = licensedAssembly;
                    license.Version        = VersionInformation.get_current_informational_version(licensedAssembly);
                    Type licensedComponent = licensedAssembly.GetType(ApplicationParameters.LicensedComponentRegistry, throwOnError: false, ignoreCase: true);
                    SimpleInjectorContainer.add_component_registry_class(licensedComponent);
                }
                catch (Exception ex)
                {
                    "chocolatey".Log().Error(
                        @"Error when attempting to load chocolatey licensed assembly. Ensure
 that chocolatey.licensed.dll exists at
 '{0}'.
 The error message itself may be helpful:{1} {2}".format_with(
                            ApplicationParameters.LicensedAssemblyLocation,
                            Environment.NewLine,
                            ex.Message
                            ));
                    "chocolatey".Log().Warn(ChocolateyLoggers.Important, @" Install the Chocolatey Licensed Extension package with
 `choco install chocolatey.extension` to remove this license warning.
 TRIALS: If you have a trial license, you cannot use the above command
 as is and be successful. You need to download nupkgs from the links in
 the trial email as your license will not be registered on the licensed
 repository. Please reference
 https://chocolatey.org/docs/installation-licensed#how-do-i-install-the-trial-edition
 for specific instructions.");
                }
            }

            return(license);
        }
Exemplo n.º 27
0
 private void addButton_Click(object sender, EventArgs e)
 {
     VersionInformation.Clear();
     QtVersionManager.The().ClearVersionCache();
     using (var dia = new AddQtVersionDialog()) {
         dia.StartPosition = FormStartPosition.CenterParent;
         var ww = new MainWinWrapper(Vsix.Instance.Dte);
         if (dia.ShowDialog(ww) == DialogResult.OK)
         {
             UpdateListBox();
             SetupDefaultVersionComboBox(null);
         }
     }
 }
Exemplo n.º 28
0
 protected void SetParams(
     string projectName,
     string bannerLocation,
     VersionInformation versionInfo,
     string documentationLocation,
     string projectID
     )
 {
     _projectName           = projectName;
     _bannerLocation        = bannerLocation;
     _versionInfo           = versionInfo;
     _documentationLocation = documentationLocation;
     _projectID             = projectID;
 }
Exemplo n.º 29
0
        public string GenerateUpdate(string workFolder, string zipDestination, VersionNumber appliesTo, VersionNumber resultsIn, IList <UpdateFile> files)
        {
            string finalFile = workFolder + Path.DirectorySeparatorChar + resultsIn + ".zip";

            // check if zipDestination exists
            if (!Directory.Exists(zipDestination))
            {
                throw new DirectoryNotFoundException("zipDestination: " + zipDestination);
            }

            // regenerate local work folder
            if (Directory.Exists(workFolder))
            {
                Directory.Delete(workFolder, true);
            }
            Directory.CreateDirectory(workFolder);

            // copy files to  workFolder and generate folder structure
            foreach (UpdateFile file in files)
            {
                if (!Directory.Exists(workFolder + Path.DirectorySeparatorChar + file.DestinationFolder))
                {
                    Directory.CreateDirectory(workFolder + Path.DirectorySeparatorChar + file.DestinationFolder);
                }
                File.Copy(file.Name, workFolder + Path.DirectorySeparatorChar + file.DestinationFolder + Path.DirectorySeparatorChar + Path.GetFileName(file.Name));
                file.Name = Path.GetFileName(file.Name);
            }

            // generate info.xml
            VersionInformation info = new VersionInformation();

            info.AppliesToVersion = appliesTo;
            info.ResultsInVersion = resultsIn;
            info.Files            = files as List <UpdateFile>;
            DeSerializer.Serialize(info, workFolder + Path.DirectorySeparatorChar + "info.xml");

            // zip that stuff and copy zip to zipDestination);))
            FastZip zip = new FastZip();

            zip.CreateZip(zipDestination + Path.DirectorySeparatorChar + Path.GetFileName(finalFile), workFolder, true, "");

            //File.Copy(finalFile, zipDestination + Path.DirectorySeparatorChar + Path.GetFileName(finalFile));

            if (Directory.Exists(workFolder))
            {
                Directory.Delete(workFolder, true);
            }

            return(zipDestination + Path.DirectorySeparatorChar + Path.GetFileName(finalFile));
        }
Exemplo n.º 30
0
        private void okButton_Click(object sender, EventArgs e)
        {
            QtVersionManager   vm          = QtVersionManager.The();
            VersionInformation versionInfo = null;

            try
            {
                versionInfo = new VersionInformation(pathBox.Text);
            }
            catch (Exception exception)
            {
                if (nameBox.Text == "$(QTDIR)")
                {
                    string defaultVersion = vm.GetDefaultVersion();
                    versionInfo = vm.GetVersionInfo(defaultVersion);
                }
                else
                {
                    Messages.DisplayErrorMessage(exception.Message);
                    return;
                }
            }

            if (versionInfo.IsWinCEVersion())
            {
                // check whether we have an SDK installed for this platform
                string platformName = versionInfo.GetVSPlatformName();
                if (!HelperFunctions.IsPlatformAvailable(VSPackage.dte, platformName))
                {
                    MessageBox.Show(SR.GetString("AddQtVersionDialog_PlatformNotFoundError", platformName),
                                    null, MessageBoxButtons.OK,
                                    MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    return;
                }
            }

            string makefileGenerator = versionInfo.GetQMakeConfEntry("MAKEFILE_GENERATOR");

            if (makefileGenerator != "MSVC.NET" && makefileGenerator != "MSBUILD" &&
                makefileGenerator != "MSVC.NETMSBUILD")
            {
                MessageBox.Show(SR.GetString("AddQtVersionDialog_IncorrectMakefileGenerator", makefileGenerator),
                                null, MessageBoxButtons.OK,
                                MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                return;
            }
            vm.SaveVersion(nameBox.Text, pathBox.Text);
            DialogResult = DialogResult.OK;
            Close();
        }
        public static async Task Run(GeotabDataOnlyPlanAPI api)
        {
            ConsoleUtility.LogExampleStarted(typeof(GetVersionInformationAsyncExample).Name);

            try
            {
                VersionInformation versionInformation = await api.GetVersionInformationAsync();
            }
            catch (Exception ex)
            {
                ConsoleUtility.LogError(ex);
            }

            ConsoleUtility.LogExampleFinished(typeof(GetVersionInformationAsyncExample).Name);
        }
 public bool Match(VersionInformation other, bool looseMatch)
 {
     if(looseMatch)
     {
         return other.Name == Name &&
                other.Major == Major &&
                other.Minor == Minor;
     }
     else
     {
         return other.Name == Name &&
                other.Major == Major &&
                other.Minor == Minor &&
                other.Patch == Patch;
     }
 }
Exemplo n.º 33
0
        public void Init(Texture2D _banner, VersionInformation _versionInformation, string userGuidePath, string assetStoreContentID = null, bool isAbout = false)
        {
            banner = _banner;

            //ensure the banner is not null.
            if (banner == null)
                banner = EditorGUIUtility.whiteTexture;

            UserGuidePath = userGuidePath;
            IsAbout = isAbout;
            AssetStoreContentID = assetStoreContentID;

            if (System.IO.File.Exists(FileUtil.GetProjectRelativePath(userGuidePath)) == false)
                UserGuidePath = null;

            versionInformation = _versionInformation;
            minSize = maxSize = new Vector2(banner == EditorGUIUtility.whiteTexture ? 350 : banner.width, 500);
        }
Exemplo n.º 34
0
 protected void SetParams(
     string projectName,
     string bannerLocation,
     VersionInformation versionInfo,
     string documentationLocation,
     string projectID
 )
 {
     _projectName = projectName;
     _bannerLocation = bannerLocation;
     _versionInfo = versionInfo;
     _documentationLocation = documentationLocation;
     _projectID = projectID;
 }