This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7A025307-D06E-48FF-A443-DCD16530A6DD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PreviousInstall.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,101 @@
using System;
using Common.Properties;
using Microsoft.Win32;
namespace Installer.Common
{
public static class PreviousInstall
{
public static string GetMostRecentlyInstalledSubKeyName(Version installingVersion, out string mostRecentlyInstalledLowerVersion)
{
mostRecentlyInstalledLowerVersion = string.Empty;
var mostRecentlyInstalledSubKeyName = string.Empty;
var rk = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
var sk1 = rk.OpenSubKey(Settings.Default.RegistrySoftwareInstalledProducts);
var maxProductVersion = new Version(0, 0, 0);
if (sk1 == null) return string.Empty;
foreach (var productSubKeyName in sk1.GetSubKeyNames())
{
var newKey = sk1.OpenSubKey(productSubKeyName);
if (newKey == null) continue;
var newSubKey = newKey.OpenSubKey(Settings.Default.RegistryInstallProperties);
if (newSubKey == null) continue;
var val = newSubKey.GetValue(Settings.Default.RegistryDisplayName, -1, RegistryValueOptions.None).ToString();
if ((val == "-1") || (val != Settings.Default.RegistryDataPRO)) continue;
var strThisVersion = newSubKey.GetValue(Settings.Default.RegistryDisplayVersion, -1, RegistryValueOptions.None).ToString();
var thisVersion = new Version(strThisVersion);
if (thisVersion.IsGreaterThan(maxProductVersion) && thisVersion.IsLessThan(installingVersion))
{
maxProductVersion = thisVersion;
mostRecentlyInstalledLowerVersion = thisVersion.ToString();
mostRecentlyInstalledSubKeyName = productSubKeyName;
}
}
return mostRecentlyInstalledSubKeyName;
}
public static bool IsGreaterThan(this Version leftString, Version rightString)
{
return leftString.CompareTo(rightString) > 0;
}
public static bool IsLessThan(this Version leftString, Version rightString)
{
return leftString.CompareTo(rightString) < 0;
}
public static string GetMostRecentlyInstalledPath(string mostRecentlyInstalledSubKeyName)
{
var log = new System.Diagnostics.EventLog();
log.Source = "DataPROInstaller";
var mostRecentlyInstalledPath = string.Empty;
var rk = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
//Look first in Products
var sk1 = rk.OpenSubKey(Settings.Default.RegistrySoftwareInstalledProducts);
if (sk1 != null)
{
log.WriteEntry("Looking in Products");
foreach (var productSubKeyName in sk1.GetSubKeyNames())
{
if (productSubKeyName != mostRecentlyInstalledSubKeyName) continue;
var newKey = sk1.OpenSubKey(productSubKeyName);
if (newKey == null) continue;
newKey = newKey.OpenSubKey(Settings.Default.RegistryInstallProperties);
if (newKey == null) continue;
var val = newKey.GetValue(Settings.Default.RegistryInstallLocation, -1, RegistryValueOptions.None).ToString();
if ((val == "-1") || (string.IsNullOrWhiteSpace(val))) continue;
mostRecentlyInstalledPath = val;
if (mostRecentlyInstalledPath.Contains(Settings.Default.DTSSuite))
{
mostRecentlyInstalledPath += Settings.Default.RegistryDataPRO + "\\";
}
log.WriteEntry("GetMostRecentlyInstalledPath returned " + mostRecentlyInstalledPath + " from Products");
return mostRecentlyInstalledPath;
}
}
//Look in Components
log.WriteEntry("Looking in Components");
sk1 = rk.OpenSubKey(Settings.Default.RegistrySoftwareInstalledComponents);
if (sk1 == null) return string.Empty;
foreach (var productSubKeyName in sk1.GetSubKeyNames())
{
var newKey = sk1.OpenSubKey(productSubKeyName);
if (newKey == null) continue;
var val = newKey.GetValue(mostRecentlyInstalledSubKeyName, -1, RegistryValueOptions.None).ToString();
if ((val == "-1") || (!val.EndsWith(Settings.Default.RegistryDataPROExeConfig))) continue;
mostRecentlyInstalledPath = val.Substring(0, val.Length - Settings.Default.RegistryDataPROExeConfig.Length);
if (mostRecentlyInstalledPath.Contains(Settings.Default.DTSSuite))
{
mostRecentlyInstalledPath += Settings.Default.RegistryDataPRO + "\\";
}
log.WriteEntry("GetMostRecentlyInstalledPath returned " + mostRecentlyInstalledPath + " from Components");
return mostRecentlyInstalledPath;
}
log.WriteEntry("GetMostRecentlyInstalledPath returned " + mostRecentlyInstalledPath);
return mostRecentlyInstalledPath;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Installer.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Installer.Common")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7a025307-d06e-48ff-a443-dcd16530a6dd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,109 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Common.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.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;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Installer\\\\UserData\\\\S-1-5-18\\\\Prod" +
"ucts")]
public string RegistrySoftwareInstalledProducts {
get {
return ((string)(this["RegistrySoftwareInstalledProducts"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("InstallProperties")]
public string RegistryInstallProperties {
get {
return ((string)(this["RegistryInstallProperties"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DisplayName")]
public string RegistryDisplayName {
get {
return ((string)(this["RegistryDisplayName"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DataPRO")]
public string RegistryDataPRO {
get {
return ((string)(this["RegistryDataPRO"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DisplayVersion")]
public string RegistryDisplayVersion {
get {
return ((string)(this["RegistryDisplayVersion"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Installer\\\\UserData\\\\S-1-5-18\\\\Comp" +
"onents")]
public string RegistrySoftwareInstalledComponents {
get {
return ((string)(this["RegistrySoftwareInstalledComponents"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DataPRO.exe.config")]
public string RegistryDataPROExeConfig {
get {
return ((string)(this["RegistryDataPROExeConfig"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("InstallLocation")]
public string RegistryInstallLocation {
get {
return ((string)(this["RegistryInstallLocation"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DTS.Suite")]
public string DTSSuite {
get {
return ((string)(this["DTSSuite"]));
}
}
}
}

View File

@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Common.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="RegistrySoftwareInstalledProducts" Type="System.String" Scope="Application">
<Value Profile="(Default)">SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products</Value>
</Setting>
<Setting Name="RegistryInstallProperties" Type="System.String" Scope="Application">
<Value Profile="(Default)">InstallProperties</Value>
</Setting>
<Setting Name="RegistryDisplayName" Type="System.String" Scope="Application">
<Value Profile="(Default)">DisplayName</Value>
</Setting>
<Setting Name="RegistryDataPRO" Type="System.String" Scope="Application">
<Value Profile="(Default)">DataPRO</Value>
</Setting>
<Setting Name="RegistryDisplayVersion" Type="System.String" Scope="Application">
<Value Profile="(Default)">DisplayVersion</Value>
</Setting>
<Setting Name="RegistrySoftwareInstalledComponents" Type="System.String" Scope="Application">
<Value Profile="(Default)">SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components</Value>
</Setting>
<Setting Name="RegistryDataPROExeConfig" Type="System.String" Scope="Application">
<Value Profile="(Default)">DataPRO.exe.config</Value>
</Setting>
<Setting Name="RegistryInstallLocation" Type="System.String" Scope="Application">
<Value Profile="(Default)">InstallLocation</Value>
</Setting>
<Setting Name="DTSSuite" Type="System.String" Scope="Application">
<Value Profile="(Default)">DTS.Suite</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="Installer.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
<applicationSettings>
<Common.Properties.Settings>
<setting name="RegistrySoftwareInstalledProducts" serializeAs="String">
<value>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products</value>
</setting>
<setting name="RegistryInstallProperties" serializeAs="String">
<value>InstallProperties</value>
</setting>
<setting name="RegistryDisplayName" serializeAs="String">
<value>DisplayName</value>
</setting>
<setting name="RegistryDataPRO" serializeAs="String">
<value>DataPRO</value>
</setting>
<setting name="RegistryDisplayVersion" serializeAs="String">
<value>DisplayVersion</value>
</setting>
<setting name="RegistrySoftwareInstalledComponents" serializeAs="String">
<value>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components</value>
</setting>
<setting name="RegistryDataPROExeConfig" serializeAs="String">
<value>DataPRO.exe.config</value>
</setting>
<setting name="RegistryInstallLocation" serializeAs="String">
<value>InstallLocation</value>
</setting>
<setting name="DTSSuite" serializeAs="String">
<value>DTS.Suite</value>
</setting>
</Common.Properties.Settings>
<Installer.Common.Properties.Settings>
<setting name="RegistrySoftwareInstalledProducts" serializeAs="String">
<value>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products</value>
</setting>
<setting name="RegistryInstallProperties" serializeAs="String">
<value>InstallProperties</value>
</setting>
<setting name="RegistryDisplayName" serializeAs="String">
<value>DisplayName</value>
</setting>
<setting name="RegistryDataPRO" serializeAs="String">
<value>DataPRO</value>
</setting>
<setting name="RegistryDisplayVersion" serializeAs="String">
<value>DisplayVersion</value>
</setting>
<setting name="RegistrySoftwareInstalledComponents" serializeAs="String">
<value>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components</value>
</setting>
<setting name="RegistryDataPROExeConfig" serializeAs="String">
<value>DataPRO.exe.config</value>
</setting>
</Installer.Common.Properties.Settings>
</applicationSettings>
</configuration>

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]