commit 67af2983c9909641e1061e6fcfa4fe0677a3fd31 Author: Eugen Höglinger Date: Wed May 19 18:16:29 2021 +0200 Initialize diff --git a/.vs/ShowInstalledNXversion.git/v16/.suo b/.vs/ShowInstalledNXversion.git/v16/.suo new file mode 100644 index 0000000..ea597eb Binary files /dev/null and b/.vs/ShowInstalledNXversion.git/v16/.suo differ diff --git a/ShowInstalledNXversion.git.sln b/ShowInstalledNXversion.git.sln new file mode 100644 index 0000000..d26d147 --- /dev/null +++ b/ShowInstalledNXversion.git.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31229.75 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowInstalledNXversion", "ShowInstalledNXversion\ShowInstalledNXversion.csproj", "{FE338789-C034-4E03-9125-E61485F1FB3B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE338789-C034-4E03-9125-E61485F1FB3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE338789-C034-4E03-9125-E61485F1FB3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE338789-C034-4E03-9125-E61485F1FB3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE338789-C034-4E03-9125-E61485F1FB3B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5F42E04A-70DA-437D-B229-24358758A044} + EndGlobalSection +EndGlobal diff --git a/ShowInstalledNXversion/App.config b/ShowInstalledNXversion/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/ShowInstalledNXversion/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ShowInstalledNXversion/Form1.Designer.cs b/ShowInstalledNXversion/Form1.Designer.cs new file mode 100644 index 0000000..f4f48dc --- /dev/null +++ b/ShowInstalledNXversion/Form1.Designer.cs @@ -0,0 +1,182 @@ + +namespace ShowInstalledNXversion +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.labelInstallationFolder = new System.Windows.Forms.Label(); + this.groupBoxSelect = new System.Windows.Forms.GroupBox(); + this.comboBoxInstalledNX = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.buttonInstallationFolder = new System.Windows.Forms.Button(); + this.textBoxInstallationFolder = new System.Windows.Forms.TextBox(); + this.groupBoxResult = new System.Windows.Forms.GroupBox(); + this.textBoxInstalledNxVersion = new System.Windows.Forms.TextBox(); + this.labelInstalledNxVersion = new System.Windows.Forms.Label(); + this.buttonShowVersion = new System.Windows.Forms.Button(); + this.groupBoxSelect.SuspendLayout(); + this.groupBoxResult.SuspendLayout(); + this.SuspendLayout(); + // + // labelInstallationFolder + // + this.labelInstallationFolder.AutoSize = true; + this.labelInstallationFolder.Location = new System.Drawing.Point(6, 22); + this.labelInstallationFolder.Name = "labelInstallationFolder"; + this.labelInstallationFolder.Size = new System.Drawing.Size(89, 13); + this.labelInstallationFolder.TabIndex = 0; + this.labelInstallationFolder.Text = "Installation Folder"; + // + // groupBoxSelect + // + this.groupBoxSelect.Controls.Add(this.comboBoxInstalledNX); + this.groupBoxSelect.Controls.Add(this.label1); + this.groupBoxSelect.Controls.Add(this.buttonInstallationFolder); + this.groupBoxSelect.Controls.Add(this.textBoxInstallationFolder); + this.groupBoxSelect.Controls.Add(this.labelInstallationFolder); + this.groupBoxSelect.Location = new System.Drawing.Point(12, 12); + this.groupBoxSelect.Name = "groupBoxSelect"; + this.groupBoxSelect.Size = new System.Drawing.Size(369, 72); + this.groupBoxSelect.TabIndex = 1; + this.groupBoxSelect.TabStop = false; + this.groupBoxSelect.Text = "Select"; + // + // comboBoxInstalledNX + // + this.comboBoxInstalledNX.FormattingEnabled = true; + this.comboBoxInstalledNX.Location = new System.Drawing.Point(112, 45); + this.comboBoxInstalledNX.Name = "comboBoxInstalledNX"; + this.comboBoxInstalledNX.Size = new System.Drawing.Size(250, 21); + this.comboBoxInstalledNX.TabIndex = 5; + this.comboBoxInstalledNX.SelectedIndexChanged += new System.EventHandler(this.comboBoxInstalledNX_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 49); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(60, 13); + this.label1.TabIndex = 4; + this.label1.Text = "NX Version"; + // + // buttonInstallationFolder + // + this.buttonInstallationFolder.Location = new System.Drawing.Point(288, 17); + this.buttonInstallationFolder.Name = "buttonInstallationFolder"; + this.buttonInstallationFolder.Size = new System.Drawing.Size(75, 23); + this.buttonInstallationFolder.TabIndex = 2; + this.buttonInstallationFolder.Text = "..."; + this.buttonInstallationFolder.UseVisualStyleBackColor = true; + this.buttonInstallationFolder.Click += new System.EventHandler(this.buttonInstallationFolder_Click); + // + // textBoxInstallationFolder + // + this.textBoxInstallationFolder.Location = new System.Drawing.Point(112, 19); + this.textBoxInstallationFolder.Name = "textBoxInstallationFolder"; + this.textBoxInstallationFolder.Size = new System.Drawing.Size(170, 20); + this.textBoxInstallationFolder.TabIndex = 1; + this.textBoxInstallationFolder.Text = "C:\\CAD"; + this.textBoxInstallationFolder.TextChanged += new System.EventHandler(this.textBoxInstallationFolder_TextChanged); + this.textBoxInstallationFolder.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxInstallationFolder_KeyDown); + // + // groupBoxResult + // + this.groupBoxResult.Controls.Add(this.textBoxInstalledNxVersion); + this.groupBoxResult.Controls.Add(this.labelInstalledNxVersion); + this.groupBoxResult.Location = new System.Drawing.Point(12, 90); + this.groupBoxResult.Name = "groupBoxResult"; + this.groupBoxResult.Size = new System.Drawing.Size(368, 46); + this.groupBoxResult.TabIndex = 2; + this.groupBoxResult.TabStop = false; + this.groupBoxResult.Text = "Result"; + // + // textBoxInstalledNxVersion + // + this.textBoxInstalledNxVersion.Location = new System.Drawing.Point(111, 20); + this.textBoxInstalledNxVersion.Name = "textBoxInstalledNxVersion"; + this.textBoxInstalledNxVersion.ReadOnly = true; + this.textBoxInstalledNxVersion.Size = new System.Drawing.Size(251, 20); + this.textBoxInstalledNxVersion.TabIndex = 1; + // + // labelInstalledNxVersion + // + this.labelInstalledNxVersion.AutoSize = true; + this.labelInstalledNxVersion.Location = new System.Drawing.Point(6, 23); + this.labelInstalledNxVersion.Name = "labelInstalledNxVersion"; + this.labelInstalledNxVersion.Size = new System.Drawing.Size(102, 13); + this.labelInstalledNxVersion.TabIndex = 0; + this.labelInstalledNxVersion.Text = "Installed NX Version"; + // + // buttonShowVersion + // + this.buttonShowVersion.Location = new System.Drawing.Point(12, 143); + this.buttonShowVersion.Name = "buttonShowVersion"; + this.buttonShowVersion.Size = new System.Drawing.Size(368, 23); + this.buttonShowVersion.TabIndex = 3; + this.buttonShowVersion.Text = "Export all NX installation to \'Installed NX-Versions.txt\' on the Desktop"; + this.buttonShowVersion.UseVisualStyleBackColor = true; + this.buttonShowVersion.Click += new System.EventHandler(this.buttonShowVersion_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(392, 178); + this.Controls.Add(this.buttonShowVersion); + this.Controls.Add(this.groupBoxResult); + this.Controls.Add(this.groupBoxSelect); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.Name = "Form1"; + this.Text = "Show Installed NX Version"; + this.Load += new System.EventHandler(this.Form1_Load); + this.groupBoxSelect.ResumeLayout(false); + this.groupBoxSelect.PerformLayout(); + this.groupBoxResult.ResumeLayout(false); + this.groupBoxResult.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; + private System.Windows.Forms.Label labelInstallationFolder; + private System.Windows.Forms.GroupBox groupBoxSelect; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonInstallationFolder; + private System.Windows.Forms.TextBox textBoxInstallationFolder; + private System.Windows.Forms.GroupBox groupBoxResult; + private System.Windows.Forms.TextBox textBoxInstalledNxVersion; + private System.Windows.Forms.Label labelInstalledNxVersion; + private System.Windows.Forms.Button buttonShowVersion; + private System.Windows.Forms.ComboBox comboBoxInstalledNX; + } +} + diff --git a/ShowInstalledNXversion/Form1.cs b/ShowInstalledNXversion/Form1.cs new file mode 100644 index 0000000..4545696 --- /dev/null +++ b/ShowInstalledNXversion/Form1.cs @@ -0,0 +1,227 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Eugen.ESystem; +using Eugen.ESystem.IO; +using Eugen.NX; + +namespace ShowInstalledNXversion +{ + public partial class Form1 : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + string startYear = ""; + if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © ")) + { + startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", ""); + while (startYear.StartsWith(" ")) + { + startYear = startYear.Remove(0, 1); + } + startYear = startYear.Remove(startYear.IndexOf(" ")); + return startYear; + } + else + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear)); + } + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + public Form1() + { + SetProgramInfo(); + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + InstalledVersions(); + } + + private void textBoxInstallationFolder_TextChanged(object sender, EventArgs e) + { + if (String.IsNullOrEmpty(textBoxInstallationFolder.Text)) + { + textBoxInstalledNxVersion.Text = ""; + } + } + + private void textBoxInstallationFolder_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + if (textBoxInstallationFolder.Text.EndsWith("\\")) + { + textBoxInstallationFolder.Text = textBoxInstallationFolder.Text.TrimEnd('\\'); + } + InstallationFolder = textBoxInstallationFolder.Text; + + InstalledVersions(); + } + } + + private void buttonInstallationFolder_Click(object sender, EventArgs e) + { + if (folderBrowserDialog.ShowDialog() == DialogResult.OK) + { + textBoxInstallationFolder.Text = folderBrowserDialog.SelectedPath; + + InstalledVersions(); + } + } + + private void comboBoxInstalledNX_SelectedIndexChanged(object sender, EventArgs e) + { + NxVersion = comboBoxInstalledNX.SelectedItem.ToString(); + + ShowVersion(); + } + + private void buttonShowVersion_Click(object sender, EventArgs e) + { + var wltd = new WriteListToDesktop(InstallationFolder, InstalledNxVersions); + } + + protected string InstallationFolder { private set; get; } + protected List InstalledNxVersions { private set; get; } + protected string NxVersion { private set; get; } + + private void InstalledVersions() + { + if (Directory.Exists(textBoxInstallationFolder.Text)) + { + InstallationFolder = textBoxInstallationFolder.Text; + InstalledNxVersions = NxVersions(textBoxInstallationFolder.Text); + + foreach (var item in InstalledNxVersions) + { + comboBoxInstalledNX.Items.Add(item); + } + comboBoxInstalledNX.SelectedIndex = 0; + comboBoxInstalledNX.Refresh(); + NxVersion = comboBoxInstalledNX.SelectedItem.ToString(); + + ShowVersion(); + } + else + { + textBoxInstallationFolder.Text = ""; + InstallationFolder = textBoxInstallationFolder.Text; + textBoxInstalledNxVersion.Text = ""; + } + } + + private List NxVersions(string folder) + { + List version = new List(); + + if (Directory.Exists(folder)) + { + + string pattern = "NX"; + + var versionPath = new ReadFoldersFromFolder(folder, pattern, true, false); + foreach (var item in versionPath.FoldersFound) + { + version.Add(item.Remove(0, item.LastIndexOf("\\") + 1).Replace(pattern, "")); + } + } + else + { + throw new DirectoryNotFoundException(folder); + } + + return version; + } + + private void ShowVersion() + { + NxVersion nxVer = new NxVersion(String.Concat(InstallationFolder, "\\NX", NxVersion)); //Informationen über diese Version abrufen + + if (Convert.ToInt32(NxVersion) <= 12) + { + textBoxInstalledNxVersion.Text = nxVer.NXpatch; + } + else + { + textBoxInstalledNxVersion.Text = String.Concat(nxVer.UgiiMajorVersion, ".", nxVer.UgiiMinorVersion); + } + + } + } +} diff --git a/ShowInstalledNXversion/Form1.resx b/ShowInstalledNXversion/Form1.resx new file mode 100644 index 0000000..b8f6272 --- /dev/null +++ b/ShowInstalledNXversion/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ShowInstalledNXversion/Program.cs b/ShowInstalledNXversion/Program.cs new file mode 100644 index 0000000..611b374 --- /dev/null +++ b/ShowInstalledNXversion/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShowInstalledNXversion +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/ShowInstalledNXversion/Properties/AssemblyInfo.cs b/ShowInstalledNXversion/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ef2c713 --- /dev/null +++ b/ShowInstalledNXversion/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("ShowInstalledNXversion")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ShowInstalledNXversion")] +[assembly: AssemblyCopyright("Copyright © 2021 by Eugen Höglinger")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("fe338789-c034-4e03-9125-e61485f1fb3b")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ShowInstalledNXversion/Properties/Resources.Designer.cs b/ShowInstalledNXversion/Properties/Resources.Designer.cs new file mode 100644 index 0000000..3dcaa00 --- /dev/null +++ b/ShowInstalledNXversion/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + + +namespace ShowInstalledNXversion.Properties +{ + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShowInstalledNXversion.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ShowInstalledNXversion/Properties/Resources.resx b/ShowInstalledNXversion/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ShowInstalledNXversion/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShowInstalledNXversion/Properties/Settings.Designer.cs b/ShowInstalledNXversion/Properties/Settings.Designer.cs new file mode 100644 index 0000000..fccff13 --- /dev/null +++ b/ShowInstalledNXversion/Properties/Settings.Designer.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace ShowInstalledNXversion.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/ShowInstalledNXversion/Properties/Settings.settings b/ShowInstalledNXversion/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/ShowInstalledNXversion/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ShowInstalledNXversion/ShowInstalledNXversion.csproj b/ShowInstalledNXversion/ShowInstalledNXversion.csproj new file mode 100644 index 0000000..a9aca1f --- /dev/null +++ b/ShowInstalledNXversion/ShowInstalledNXversion.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {FE338789-C034-4E03-9125-E61485F1FB3B} + WinExe + ShowInstalledNXversion + ShowInstalledNXversion + v4.7.2 + 512 + true + false + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\_DLL\NxVersion.git\NxVersion\bin\Debug\henxver.dll + + + ..\..\..\_DLL\ReadFoldersFromFolder.git\ReadFoldersFromFolder\bin\Debug\herfoffo.dll + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/ShowInstalledNXversion/WriteListToDesktop.cs b/ShowInstalledNXversion/WriteListToDesktop.cs new file mode 100644 index 0000000..3a18229 --- /dev/null +++ b/ShowInstalledNXversion/WriteListToDesktop.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Eugen.NX; + +namespace ShowInstalledNXversion +{ + class WriteListToDesktop + { + public WriteListToDesktop(string installationFolder, List verList) + { + VerList = verList; + InstallationFolder = installationFolder; + + string fileName = "Installed NX-Versions"; + string path = String.Concat(Environment.GetEnvironmentVariable("OneDrive"), "\\Desktop"); + string ext = "txt"; + + List list = new List(); + list = CreateList(); + + File.WriteAllLines(String.Concat(path, "\\", fileName, ".", ext), list); + } + + protected string InstallationFolder { private set; get; } + protected List VerList { private set; get; } + + private List CreateList() + { + List list = new List(); + list.Clear(); + list.Add(String.Concat("Installed NX Versions on ", Environment.GetEnvironmentVariable("COMPUTERNAME"))); + list.Add("-------------------------------------"); + list.Add("Base Version:\tInstalled Version:"); + list.Add("-------------------------------------"); + + NxVersion nxVer = new NxVersion(); //Informationen über diese Version abrufen + + foreach (var item in VerList) + { + //NxVersion nxVerion = new NxVersion(String.Concat(InstallationFolder, "\\NX", item)); //Informationen über diese Version abrufen + nxVer.GetNxVersion(String.Concat(InstallationFolder, "\\NX", item)); + + if (Convert.ToInt32(item) <= 12) + { + list.Add(String.Concat("NX", item, "\t\t\t", nxVer.NXpatch)); + } + else + { + list.Add(String.Concat("NX", item, "\t\t\t", "NX ", nxVer.UgiiMajorVersion, ".", nxVer.UgiiMinorVersion)); + } + } + + list.Add("-------------------------------------"); + list.Add(String.Concat("Number of installed NX Versions: ", VerList.Count)); + list.Add("-------------------------------------"); + + return list; + } + } +} diff --git a/ShowInstalledNXversion/bin/Debug/NxVersion.dll b/ShowInstalledNXversion/bin/Debug/NxVersion.dll new file mode 100644 index 0000000..4ba09c0 Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/NxVersion.dll differ diff --git a/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe new file mode 100644 index 0000000..68e8806 Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe differ diff --git a/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe.config b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.pdb b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.pdb new file mode 100644 index 0000000..17b57dc Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/ShowInstalledNXversion.pdb differ diff --git a/ShowInstalledNXversion/bin/Debug/henxver.dll b/ShowInstalledNXversion/bin/Debug/henxver.dll new file mode 100644 index 0000000..b0ce5f5 Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/henxver.dll differ diff --git a/ShowInstalledNXversion/bin/Debug/henxver.pdb b/ShowInstalledNXversion/bin/Debug/henxver.pdb new file mode 100644 index 0000000..5c72835 Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/henxver.pdb differ diff --git a/ShowInstalledNXversion/bin/Debug/herfoffo.dll b/ShowInstalledNXversion/bin/Debug/herfoffo.dll new file mode 100644 index 0000000..06beb4a Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/herfoffo.dll differ diff --git a/ShowInstalledNXversion/bin/Debug/herfoffo.pdb b/ShowInstalledNXversion/bin/Debug/herfoffo.pdb new file mode 100644 index 0000000..f7995a8 Binary files /dev/null and b/ShowInstalledNXversion/bin/Debug/herfoffo.pdb differ diff --git a/ShowInstalledNXversion/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/ShowInstalledNXversion/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/ShowInstalledNXversion/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..3d4e46e Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..e9abafc Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Form1.resources b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Form1.resources differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Properties.Resources.resources b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.Properties.Resources.resources differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.CopyComplete b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.CoreCompileInputs.cache b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..a037d88 --- /dev/null +++ b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +998d7a179fd4fed6e53318402ca043fe3eaee5ee diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.FileListAbsolute.txt b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..6651214 --- /dev/null +++ b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\ShowInstalledNXversion.exe.config +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\ShowInstalledNXversion.exe +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\ShowInstalledNXversion.pdb +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.csprojAssemblyReference.cache +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.Form1.resources +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.Properties.Resources.resources +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.csproj.GenerateResource.cache +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.csproj.CoreCompileInputs.cache +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.exe +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.pdb +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\herfoffo.dll +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\herfoffo.pdb +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\obj\Debug\ShowInstalledNXversion.csproj.CopyComplete +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\henxver.dll +H:\Programmieren\Git-WorkRepository\VisualStudio\_PROJEKTE\ShowInstalledNXversion.git\ShowInstalledNXversion\bin\Debug\henxver.pdb diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.GenerateResource.cache b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.GenerateResource.cache new file mode 100644 index 0000000..b6129f4 Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csproj.GenerateResource.cache differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csprojAssemblyReference.cache b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csprojAssemblyReference.cache new file mode 100644 index 0000000..93bd2f7 Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.csprojAssemblyReference.cache differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.exe b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.exe new file mode 100644 index 0000000..68e8806 Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.exe differ diff --git a/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.pdb b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.pdb new file mode 100644 index 0000000..17b57dc Binary files /dev/null and b/ShowInstalledNXversion/obj/Debug/ShowInstalledNXversion.pdb differ