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,41 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/Common/PreviousInstall.cs
generated_at: "2026-04-17T16:11:25.802939+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "d28200fca61fff55"
---
# Common
**Purpose:**
This module provides utility logic for Windows Installer custom actions. Its primary role is to interact with the Windows Registry to detect previous installations of the software. It identifies the most recent version installed (that is older than the currently installing version) and determines its installation path, facilitating upgrade or migration scenarios.
**Public Interface:**
* `PreviousInstall` (Static Class)
* `string GetMostRecentlyInstalledSubKeyName(Version installingVersion, out string mostRecentlyInstalledLowerVersion)`: Scans the registry (specifically `HKLM\Software\...Products`) for installed versions of "DataPRO". Returns the subkey name of the most recent version found that is less than `installingVersion`. The `out` parameter returns the version string.
* `string GetMostRecentlyInstalledPath(string mostRecentlyInstalledSubKeyName)`: Given a product subkey name, searches the registry ("Products" and "Components" keys) to find the installation directory path.
* `bool IsGreaterThan(this Version leftString, Version rightString)` (Extension Method): Returns true if `leftString` > `rightString`.
* `bool IsLessThan(this Version leftString, Version rightString)` (Extension Method): Returns true if `leftString` < `rightString`.
**Invariants:**
* Registry paths are read from `Settings.Default` (e.g., `RegistrySoftwareInstalledProducts`, `RegistryDisplayName`).
* The module specifically targets the `RegistryHive.LocalMachine` with `RegistryView.Registry64`.
* `GetMostRecentlyInstalledSubKeyName` only considers versions strictly less than `installingVersion`.
* `GetMostRecentlyInstalledPath` modifies the path string if it contains "DTSSuite", appending the DataPRO folder name.
**Dependencies:**
* **Depends on:**
* `System`
* `Microsoft.Win32`
* `Common.Properties` (for `Settings.Default`)
* `System.Diagnostics` (for `EventLog`)
* **Depended on by:** Installer custom actions (implied by module path).
**Gotchas:**
* **Hardcoded Event Log Source:** The method `GetMostRecentlyInstalledPath` creates an `EventLog` with `Source = "DataPROInstaller"`. If this source does not exist on the target machine, writing to the log may throw a security exception if the installer does not have sufficient privileges or if the source isn't registered beforehand.
* **Magic Strings/Values:** The code checks for `val == "-1"` to indicate missing registry values, which relies on the specific implementation of `GetValue(...).ToString()`.
* **Path Logic:** The logic appending `Settings.Default.RegistryDataPRO + "\\"` when `DTSSuite` is detected assumes a specific directory structure that may break if the suite installation layout changes.
* **Extension Method Scope:** The `IsGreaterThan` and `IsLessThan` extension methods are defined in a static class but are effectively utility methods for `Version` objects used within this class.

View File

@@ -0,0 +1,46 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/Common/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/Common/Properties/Settings.Designer.cs
generated_at: "2026-04-17T16:25:38.817230+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ed8c28138f9017aa"
---
# Properties
### Purpose
This module provides assembly metadata and strongly-typed application settings for the `Installer.Common` assembly. It defines registry path constants and key names used for locating installed products, components, and configuration information related to DataPRO installations. These settings support Windows Installer custom actions that query the registry for installation state.
### Public Interface
**`Common.Properties.Settings`** (internal sealed partial class)
- Inherits from `global::System.Configuration.ApplicationSettingsBase`
- `public static Settings Default { get; }` - Returns a synchronized singleton instance.
**Registry Path Settings** (all application-scoped, read-only):
| Property Name | Type | Default Value |
|---------------|------|---------------|
| `RegistrySoftwareInstalledProducts` | `string` | `SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products` |
| `RegistryInstallProperties` | `string` | `InstallProperties` |
| `RegistryDisplayName` | `string` | `DisplayName` |
| `RegistryDataPRO` | `string` | `DataPRO` |
| `RegistryDisplayVersion` | `string` | `DisplayVersion` |
| `RegistrySoftwareInstalledComponents` | `string` | `SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components` |
| `RegistryDataPROExeConfig` | `string` | `DataPRO.exe.config` |
| `RegistryInstallLocation` | `string` | `InstallLocation` |
| `DTSSuite` | `string` | `DTS.Suite` |
### Invariants
- All settings are `ApplicationScopedSettingAttribute`, meaning they are read-only at runtime and must be modified via the `.config` file or by regenerating the settings.
- The registry paths target the `S-1-5-18` SID (LOCAL_SYSTEM account), indicating these settings are designed for machine-level installer queries, not per-user installations.
- The `Settings` class is `internal sealed`, restricting access to the `Installer.Common` assembly.
### Dependencies
- **Depends on**: `System.Configuration.ApplicationSettingsBase`, `System.Diagnostics`, `System.Configuration` attributes
- **Depended on by**: Cannot be determined from source alone (likely consumed by custom action classes within Installer.Common)
### Gotchas
- The registry paths hardcode `S-1-5-18` (LOCAL_SYSTEM).

View File

@@ -0,0 +1,145 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/MigrationStatus.cs
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/DBConfig.cs
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/CommonUtilities.cs
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/DBTypeChoice.Designer.cs
generated_at: "2026-04-17T15:53:09.999426+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "759c4bea5bfc5343"
---
# DBConfiguration Module Documentation
## 1. Purpose
The DBConfiguration module is a Windows Forms application that serves as a custom action for the DataPRO installer. It provides database configuration and migration capabilities, allowing users to choose between Local, Centralized, or Both database configurations. The module handles SQL Server Express LocalDB instance management (create, start, stop, delete), database attach/detach operations for DataPRO and ISO databases, and supports initializing databases to preset configurations (TSR AIR, Aero, Crash) or migrating data from previous installations.
## 2. Public Interface
### MigrationStatus Class
```csharp
public class MigrationStatus
```
A data class representing migration status information.
**Properties:**
- `StatusTypes StatusType { get; set; }` - The type of status being reported
- `string StatusText { get; set; }` - The status message text
**Nested Enum:**
```csharp
public enum StatusTypes
{
Status,
MigrationStatus,
SourceDb
}
```
---
### DBConfig Class (Static)
```csharp
static class DBConfig
```
The application entry point class.
**Methods:**
- `static void Main(string[] args)` - Entry point that parses command-line arguments and launches either the configuration UI or TSR AIR initialization. Accepts arguments in order: `targetDir`, `productVersion`, `noUI`, `tsrAirGo` (boolean). Supports standalone mode with 0 or 2 arguments.
---
### CommonUtilities Class
```csharp
public class CommonUtilities
```
Core utility class for database operations.
**Constructor:**
- `CommonUtilities()` - Initializes the event log with source "DataPRODbMigratorInstaller"
**Public Methods:**
- `void InitializeDbToTSRAIR(string targetDir)` - Initializes the database to TSR AIR settings. Attaches databases, initializes via `DbOperations.Connection.Initialize()`, then detaches.
- `string Attach(string targetDbDir, string scriptsDir)` - Attaches the previous LocalDB database. Logs and sets migration status before calling `InstallDatabase()`.
- `string InstallDatabase(string dBdir, string dbName, string scriptsDir)` - Creates, starts a new LocalDB instance, and attaches both DataPRO and ISO databases. Sets `DbOperations._usingCentralizedDB = false`, `DbOperations._usingMSSQL = true`, and `DbOperations._usingNTLMAuthentication = true`.
- `string Detach(string sourceDbName, string targetDbDir, string scriptsDir)` - Detaches both the specified source database and ISO database.
- `MigrationStatus SetMigrationStatus(string migrationStatus, bool output = false)` - Sets the current migration status text and returns a `MigrationStatus` instance with `StatusTypes.MigrationStatus`.
- `string ProcessSqlLocalDbCommand(string command)` - Executes a SQL LocalDB command using the highest version of SQL Server Express LocalDB installed.
- `static string AttachOrDetachDatabase(string scriptsDir, string dbName, string sqlDbFileName, string sqlLogFileName, string attachOrDetach)` - Executes a batch file to attach or detach a database using sqlcmd.exe.
- `static void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)` - Event handler for process output, appends to static `sb` StringBuilder.
- `static string SqlCommandProcessor(string sqlLocalDbExeFileName, string command)` - Executes a SQL LocalDB command and returns output/errors.
- `static string BatchCommandProcessor(string batchFileName, string dbName, string sqlDbFileName, string sqlLogFileName, string fullSqlcmdPath)` - Executes a batch file with database parameters and returns output/errors.
**Public Fields:**
- `public static StringBuilder sb` - Static StringBuilder shared across process output handling
---
### DBTypeChoice Class (Windows Form)
```csharp
partial class DBTypeChoice
```
Configuration UI form for selecting database type and initialization options.
**Key UI Controls:**
- `rbLocal`, `rbCentralized`, `rbBoth` - Radio buttons for database type selection
- `rbMigrateLocal`, `rbAero`, `rbCrash`, `rbTSRAIR`, `rbNoneOfTheAbove` - Radio buttons for initialization mode
- `tbDBHostname`, `tbDBName`, `tbDBUser`, `tbDBPassword` - Text fields for centralized database connection
- `cbUseNTLMAuthentication`, `cbShowPassword`, `cbCopyConfig` - Checkbox options
- `tbSourceDB`, `tbDestinationDB` - Text fields for migration paths (conditionally visible)
- `btnOK`, `btnCancel` - Action buttons
## 3. Invariants
- **SQL Server Express LocalDB 2014** is a prerequisite and must be installed unless subsequently uninstalled
- Database name is hardcoded to `"DataPRO"` during TSR AIR Go installation and cannot be changed
- `Settings.Default.LocalDbFolder`, `Settings.Default.ScriptsFolder`, and other Settings values must be properly configured
- The registry path `SOFTWARE\Microsoft\Microsoft SQL Server\LocalDB\InstalledVersions` must exist for LocalDB detection
- Process output handling uses a shared static `StringBuilder` that is cleared before each operation
- The form is displayed as topmost (`TopMost = true`) with no control box (`ControlBox = false`)
## 4. Dependencies
**External Dependencies (from imports):**
- `DTS.Common.Storage` - Provides `ConfigInitializationHelper`
- `DTS.Common.Enums` - Provides `InitializationTypes`
- `DTS.Common.Utilities` - Referenced in namespace
- `DTS.Common.Utils.Database` - Provides `GetODBCToolsPath()`
- `Microsoft.Win32` - Registry access
- `System.Windows.Forms` - UI framework
- `System.Diagnostics` - `EventLog`, `Process` classes
- `System.Runtime.InteropServices` - P/Invoke support
**Internal Dependencies:**
- `DbOperations.Connection` - Used for database connection settings (`DBName`, `Server`, `Initialize()`)
- `DbOperations` - Static fields: `_usingCentralizedDB`, `_usingMSSQL`, `_usingNTLMAuthentication`
- `Settings.Default` - Application settings for paths, instance names, messages
**Native Dependencies:**
- `kernel32.dll` - `GetConsoleWindow()` function
- `user32.dll` - `ShowWindow()` function
## 5. Gotchas
1. **DEBUG mode hardcodes**: When compiled with DEBUG defined, the application uses hardcoded test paths (`D:\DTS\DTS.Suite\4.4.309\DataPRO`) and version strings. The comment instructs developers to enable this via project properties.
2. **Console window visibility**: The application hides/shows the console window via P/Invoke. In standalone mode (0 args), the window briefly flashes; with 2 args, it remains visible; when called from installer (4 args), it's hidden.
3. **Shared static StringBuilder**: The `sb` field is static and shared across `SqlCommandProcessor` and `BatchCommandProcessor`. It's cleared at the start of each call, which could cause issues if multiple operations run concurrently.
4. **Argument parsing fragility**: The `Main` method parses arguments by position (index 0-3) rather than named parameters, making the calling convention brittle.
5. **Registry dependency**: `GetSqlServerLocalDBPath()` returns `string.Empty` if the LocalDB registry keys are not found, which causes `ProcessSqlLocalDbCommand` to return an error message but not throw an exception.
6. **UI element visibility**: Several controls (`lblSourceDB`, `tbSourceDB`, `btnBrowseSourceDB`, `lblDestinationDB`, `tbDestinationDB`, `btnBrowseDestinationDB`) are initialized with `Visible = false` and their visibility logic is not shown in the designer file (likely controlled in the code-behind file `DBTypeChoice.cs` which was not provided).

View File

@@ -0,0 +1,51 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/DBConfiguration/Properties/Resources.Designer.cs
generated_at: "2026-04-17T15:55:04.289329+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "00d236f5c3fe3a52"
---
# Documentation: DBConfiguration Assembly Properties
## 1. Purpose
This module contains assembly-level metadata and auto-generated resource management infrastructure for the `DBConfiguration` component, which is part of the `DataPRO/Modules/InstallerCustomActions` subsystem. It exists to define the identity, version, and COM visibility settings for the DBConfiguration assembly, and to provide strongly-typed access to localized resources. The module serves as a configuration and resource foundation for database-related custom actions during installation processes.
## 2. Public Interface
### Assembly Attributes (AssemblyInfo.cs)
| Attribute | Value |
|-----------|-------|
| `AssemblyTitle` | `"DBConfiguration"` |
| `AssemblyDescription` | `""` (empty) |
| `AssemblyCompany` | `""` (empty) |
| `AssemblyProduct` | `"DBConfiguration"` |
| `AssemblyCopyright` | `"Copyright © 2017"` |
| `AssemblyVersion` | `"1.0.0.0"` |
| `AssemblyFileVersion` | `"1.0.0.0"` |
| `ComVisible` | `false` |
| `Guid` | `"a5087f45-0949-4e27-b367-ccb6556fc68d"` |
### Internal Class: `Resources` (Resources.Designer.cs)
**Namespace:** `DBConfiguration.Properties`
**Access Modifier:** `internal`
| Member | Signature | Description |
|--------|-----------|-------------|
| `ResourceManager` | `internal static global::System.Resources.ResourceManager ResourceManager { get; }` | Returns the cached `ResourceManager` instance for this assembly. Initializes with base name `"DBConfiguration.Properties.Resources"` on first access. |
| `Culture` | `internal static global::System.Globalization.CultureInfo Culture { get; set; }` | Gets or sets the current thread's `CurrentUICulture` for resource lookups. |
| Constructor | `internal Resources()` | Parameterless constructor. Marked with `SuppressMessageAttribute` for `CA1811:AvoidUncalledPrivateCode`. |
**Note:** The `Resources` class is marked `internal` and is not accessible outside the `DBConfiguration` assembly.
## 3. Invariants
- **Auto-generated code constraint:** The `Resources` class in `Resources.Designer.cs` is auto-generated by `System.Resources.Tools.StronglyTypedResourceBuilder` (version 17.0.0.0). Manual modifications will be lost upon regeneration.
- **COM visibility:** All types in this assembly are not visible to COM components (`ComVisible(false)` at assembly level).
- **Resource base name:** The `ResourceManager` is always initialized with the base name

View File

@@ -0,0 +1,49 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/LocalSQLDB/LocalDBPreparation.cs
- DataPRO/Modules/InstallerCustomActions/LocalSQLDB/LocalDBPrepare.cs
generated_at: "2026-04-17T16:45:09.055203+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "23d0d5081a0df6ea"
---
# Documentation: LocalSQLDB Module
## 1. Purpose
This module provides installer custom actions for preparing LocalDB database files during DataPRO installation. It determines whether the application will use a local or centralized database configuration, and if local, copies database files (`.mdf` and `.ldf`) from a previous installation to the new installation directory. This enables database migration during upgrades while preserving existing data.
---
## 2. Public Interface
### `LocalDBPreparation` (Class)
Entry point class invoked by the installer.
**Method: `Main(string[] args)`**
- **Signature:** `static void Main(string[] args)`
- **Behavior:** Parses command-line arguments, creates a `LocalDBPrepare` instance, and invokes `PrepareDB()`. On exception, displays a message box with the error message and rethrows an empty `Exception`.
**Arguments:**
- `args[0]` — Target installation directory path (`targetDir`)
- `args[1]` — Product version string (parsed into `Version`)
---
### `LocalDBPrepare` (Class)
Core logic class for database preparation.
**Constructor: `LocalDBPrepare(string targetDir, Version productVersion)`**
- Initializes the instance with the target directory and installing version.
**Method: `PrepareDB()`**
- **Signature:** `public bool PrepareDB()`
- **Behavior:**
1. Loads configuration from the newly installed executable via `GetNewConfig()`
2. Determines `DbType` from configuration (defaults to `DbType.Local` on parse failure)
3. Returns `false` if `DbType.Centralized`
4. Retrieves `dbName` from configuration (defaults to `Settings.Default.DataPRO`)
5. Returns `true` if `dbName` matches `Settings.Default.DataPRO` (case-insensitive)
6. Otherwise, copies `.mdf` and `.ldf` files from the most recent previous installation to the new location

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/LocalSQLDB/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/LocalSQLDB/Properties/Settings.Designer.cs
generated_at: "2026-04-17T16:13:20.075967+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "1f2e29b6af979ed1"
---
# Properties
### Purpose
This module provides assembly metadata and application-scoped configuration settings for the `LocalSQLDB` custom installer action. It exists to configure file paths, extensions, and registry keys related to local SQL Database deployment for the DataPRO application. The settings support the installer's ability to locate and configure local database files during installation.
### Public Interface
- **`Settings` class** (internal sealed, partial) - Auto-generated settings class inheriting from `System.Configuration.ApplicationSettingsBase`.
- `static Settings Default { get; }` - Returns the synchronized singleton instance of settings.
- `string RegistryDataPROExe { get; }` - Returns `"DataPRO.exe"`. Application-scoped setting.
- `string ApplicationSettings { get; }` - Returns `"applicationSettings"`. Application-scoped setting.
- `string LocalDbFolder { get; }` - Returns `"db"`. Application-scoped setting.
- `string Mdf { get; }` - Returns `".mdf"`. SQL Server primary database file extension. Application-scoped setting.
- `string LogLdf { get; }` - Returns `"_log.ldf"`. SQL Server log file suffix/extension. Application-scoped setting.
- `string DataPRO { get; }` - Returns `"DataPRO"`. Application-scoped setting.
### Invariants
- All settings are application-scoped and read-only at runtime.
- File extension settings (`Mdf`, `LogLdf`) must include the leading dot where appropriate (`.mdf` does, `_log.ldf` includes prefix).
### Dependencies
- **Depends on**: `System.Configuration.ApplicationSettingsBase`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices`.
- **Depended on by**: The parent `LocalSQLDB` installer custom action module (inferred from namespace).
### Gotchas
- The `LogLdf` setting value is `"_log.ldf"` which includes a prefix underscore, not just the extension. This suggests it's meant to be appended to a database name, not just a pure extension.
- The `RegistryDataPROExe` setting name suggests registry usage, but the value is just a filename without a path.
---

View File

@@ -0,0 +1,86 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/MigrateConfiguration/ConfigurationMigration.cs
generated_at: "2026-04-17T16:00:30.279115+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "f2a5a0c47cf8f162"
---
# ConfigurationMigration Module Documentation
## 1. Purpose
This module is an installer custom action executable that handles migration of configuration settings and license files from a previously installed version of DataPRO to a newly installed version. It runs during the installation process, locates the most recent prior installation, copies forward user-modified settings (preserving custom values while respecting new defaults), and migrates license files. Its role is to ensure continuity of user configuration across version upgrades.
---
## 2. Public Interface
### `ConfigurationMigration` (static class)
- **Visibility**: `internal static`
- **Namespace**: `MigrateConfiguration`
#### `Main(string[] args)` (entry point)
- **Visibility**: `private static`
- **Signature**: `void Main(string[] args)`
- **Behavior**: Entry point for the custom action. Parses command-line arguments, creates an event log source if needed, orchestrates configuration migration, and displays results via MessageBox unless suppressed.
- **Arguments** (positional, by index):
- `args[0]` - `targetDir`: Installation target directory
- `args[1]` - `productVersion`: Version of DataPRO being installed (parsed as `Version`)
- `args[2]` - `noUI`: Set to `"TRUE"` to suppress MessageBox output
- `args[3]` - `setupExeDir`: Directory containing the setup executable
#### `UpdateConfigurationIfPossible(string targetDir, Version installingVersion, string setupExeDir, out string result)`
- **Visibility**: `public static`
- **Signature**: `void UpdateConfigurationIfPossible(string targetDir, Version installingVersion, string setupExeDir, out string result)`
- **Behavior**: Locates the most recent previously installed version using `PreviousInstall.GetMostRecentlyInstalledSubKeyName`, retrieves its path, and migrates the license file. Sets `result` to describe migration status.
---
## 3. Invariants
1. **Version ordering**: Migration only proceeds if `PreviousInstall.GetMostRecentlyInstalledSubKeyName` returns a non-empty subkey (i.e., a previous version exists that is lower than `installingVersion`).
2. **Settings migration condition**: A setting is migrated only if:
- It exists in both old and new configuration files
- Its value differs between old and new configurations
- For `DownloadFolder` specifically: the old value must NOT equal `StringResources.DataUpOneLevel` (the previous default)
3. **License file identification**: A file is considered a valid DataPRO license if it contains both `"<License>"` and `"<LicenseAttributes>"` substrings.
4. **License search depth**: `FindLicenseInPath` searches up to 2 levels of subdirectories recursively.
5. **Event log source**: The module attempts to create an event log source named `"DataPROInstaller"` under log `"DataPROInstallerLog"` if it does not exist (creation failures are silently ignored).
---
## 4. Dependencies
### This module depends on:
- `MigrateConfiguration.Resources.StringResources` - Localized string constants for settings names, paths, and messages
- `Installer.Common.PreviousInstall` - Provides `GetMostRecentlyInstalledSubKeyName` and `GetMostRecentlyInstalledPath` methods
- `DTS.Common.Utilities.ConfigInitializationHelper` - Provides `GetNewSettings` method
- `DTS.Common.Utilities.SettingElementCollection` - Collection type for configuration settings
- `System.Configuration` - `ConfigurationManager`, `Configuration`, `ClientSettingsSection`, `SettingElement`
- `System.Windows.Forms` - `MessageBox` for UI output
- `System.IO` - File and directory operations
### What depends on this module:
- DataPRO installer (WiX or similar) as a custom action executable
---
## 5. Gotchas
1. **Inconsistent event log source**: In `Main`, the event log source is created as `"DataPROInstaller"`, but in `UpdateConfigurationIfPossible`, the `EventLog.Source` is set to `"MySource"` which appears to be a bug or leftover debug code—the log entry is also commented out.
2. **Extensive commented-out code**: Large blocks of code in `Main` are commented out, including logic for modifying `DownloadFolder`, `ImportArchiveFolder`, and `DTSPlugins` settings. This may represent deprecated functionality or work-in-progress.
3. **Silent exception handling**: The event log source creation in `Main` uses an empty `catch {}` block, silently ignoring any failures (e.g., permission issues).
4. **Hardcoded assumption about registry paths**: `GetOldSettings` constructs the old config path by appending `StringResources.RegistryDataPROExe` to `nextLowerPath`, which assumes the previous installation follows a specific directory structure.
5. **License priority**: `MigrateLicenseFile` prioritizes finding a license in the installer directory (`setupExeDir`'s parent) before falling back to the previous installation's license. If found in the installer, it copies that instead of migrating the old one.
6. **No rollback mechanism**: If migration partially succeeds then fails, there is no rollback of already-written changes to the new configuration file.

View File

@@ -0,0 +1,35 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/MigrateConfiguration/Properties/AssemblyInfo.cs
generated_at: "2026-04-17T16:15:12.799275+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6a6224dddd7e7c70"
---
# Properties
### Purpose
This module contains only assembly-level metadata for the `MigrateConfiguration` component. It provides versioning, copyright, and COM visibility settings for the assembly but contains no executable logic or public types.
### Public Interface
No public types or members are defined in this file. This is purely assembly-level attribute configuration:
- `AssemblyTitle`: "MigrateConfiguration"
- `AssemblyVersion`: "1.0.0.0"
- `AssemblyFileVersion`: "1.0.0.0"
- `ComVisible`: `false`
- `Guid`: "c255c030-ef08-4974-8654-969e29ab3b77"
### Invariants
- The assembly version is fixed at 1.0.0.0.
- COM visibility is disabled for all types in this assembly.
### Dependencies
- **Depends on**: `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices` (for attribute definitions only).
- **Depended by**: Unclear from source alone; the actual `MigrateConfiguration` implementation code is not provided in this module.
### Gotchas
- The `AssemblyDescription` attribute is empty, providing no documentation of the assembly's purpose.
- The actual migration logic is not present in this file; only assembly metadata is defined here.
---

View File

@@ -0,0 +1,52 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/MigrateConfiguration/Resources/StringResources.Designer.cs
generated_at: "2026-04-17T16:00:53.953284+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "01948aae8b98627d"
---
# Documentation: StringResources.Designer.cs
## 1. Purpose
This module is an auto-generated strongly-typed resource class that provides localized string constants for the `MigrateConfiguration` installer custom action. It exists to centralize all user-facing messages, configuration key names, path templates, and status strings used during configuration migration operations when upgrading or installing DataPRO. The resource strings indicate this module handles migration of `DataPRO.exe.config` settings between versions, license file copying, and plugin path configuration updates.
## 2. Public Interface
**Note:** This class is marked `internal`, so it is only accessible within the `MigrateConfiguration` assembly.
### Class: `StringResources` (internal)
Namespace: `MigrateConfiguration.Resources`
| Member | Signature | Description |
|--------|-----------|-------------|
| `ResourceManager` | `internal static global::System.Resources.ResourceManager ResourceManager { get; }` | Returns the cached `ResourceManager` instance for this assembly. Lazily initialized on first access. |
| `Culture` | `internal static global::System.Globalization.CultureInfo Culture { get; set; }` | Gets or sets the current thread's `CurrentUICulture` for resource lookups. |
### Resource String Properties (all `internal static string`, getter only):
| Property Name | Inferred Purpose |
|---------------|------------------|
| `ApplicationSettings` | Returns `"applicationSettings"` - likely an XML element/section name. |
| `ConfigDidNotNeedToBeUpdated` | Status message indicating no config changes were required. |
| `ConfigMigrationStatus` | Label for config migration status reporting. |
| `ConfigWasUpdated` | Format string with placeholder `{0}` for installation version info. |
| `DataPROWin7PropertiesSettings` | Returns `"DataPROWin7.Properties.Settings"` - legacy settings section identifier. |
| `DataUpOneLevel` | Returns `"..\Data"` - relative path to Data directory. |
| `DataUpTwoLevels` | Returns `"..\..\Data"` - relative path to Data directory (two levels up). |
| `DownloadFolder` | Returns `"DownloadFolder"` - configuration key name. |
| `DTSCommonCorePluginLibConfig` | Returns `"DTS.Common.Core.PluginLib.Config"` - configuration section name. |
| `DTSPlugins` | Returns `"DTSPlugins"` - configuration key name. |
| `DTSPluginsNeedsModification` | Warning message about manual config modification required. |
| `DTSViewerModules` | Returns `"DTSViewerModules"` - configuration key name. |
| `FailedToCopyLicense` | Error message for license copy failure. |
| `ImportArchiveFolder` | Returns `"ImportArchiveFolder"` - configuration key name. |
| `ImportArchiveUpTwoLevels` | Returns `"..\..\ImportArchive"` - relative path for import archive. |
| `InstallerLicenseFileFoundCopied` | Success message for license file copy from installer. |
| `KeyNotFound` | Format string with placeholder `{0}` for key name. |
| `NewSettingsCouldNotBeFound` | Warning format string with placeholders `{0}` and `{1}`. |
| `NewSettingsCouldNotBeProcessed` | Warning message for processing failure of new settings. |
| `NoLicenseFound` | Status message when no license exists to copy

View File

@@ -0,0 +1,58 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/OpenFolder/App.xaml.cs
- DataPRO/Modules/InstallerCustomActions/OpenFolder/Folder.cs
- DataPRO/Modules/InstallerCustomActions/OpenFolder/MainWindow.xaml.cs
generated_at: "2026-04-17T16:44:48.655732+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "fe185878ebf66d1c"
---
# Documentation: OpenFolder Module
## 1. Purpose
The `OpenFolder` module is a lightweight utility designed as an installer custom action. Its sole responsibility is to open a specific folder (identified as a "manuals folder") in Windows Explorer during or after an installation process. It serves as a bridge between the installer and the Windows shell, accepting a folder path as a command-line argument and delegating the actual folder opening operation to an external utility class.
---
## 2. Public Interface
### `OpenFolder.App`
- **Kind**: Class (WPF Application)
- **Inherits**: `System.Windows.Application`
- **Signature**: `public partial class App : Application`
- **Description**: Standard WPF application entry point. Contains no custom logic beyond the auto-generated partial class definition.
### `OpenFolder.Folder`
- **Kind**: Class
- **Signature**: `class Folder`
- **Members**:
- `static void Main(string[] args)` — Application entry point. Accepts a command-line argument array, extracts `args[0]` as the folder path, and passes it to `WindowsFolder.OpenManualsFolder()`. All exceptions are caught and silently discarded.
### `OpenFolder.MainWindow`
- **Kind**: Class (WPF Window)
- **Inherits**: `System.Windows.Window`
- **Signature**: `public partial class MainWindow : Window`
- **Description**: Standard WPF window code-behind. Contains only the constructor calling `InitializeComponent()`. **Note**: This window is never instantiated or shown by the `Main` entry point.
---
## 3. Invariants
- **Argument requirement**: The `Main` method assumes `args` contains at least one element. Accessing `args[0]` without validation means the caller must guarantee an argument is provided.
- **Silent failure**: All exceptions thrown during the folder opening operation are caught and suppressed. The application will always exit without propagating errors to the caller.
- **No UI interaction**: Despite being a WPF application with a `MainWindow`, the `Main` method never creates or displays any UI elements.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Classes.WindowsFolders.WindowsFolder`** — External class providing the static method `OpenManualsFolder(string)`. The exact behavior and location of this class is not visible in the provided source.
- **WPF assemblies**: `System.Windows`, `System.Windows.Controls`, `System.Windows.Data`, `System.Windows.Documents`, `System.Windows.Input`, `System.Windows.Media`, `System.Windows.Media.Imaging`, `System.Windows.Navigation`, `System.Windows.Shapes`
- **Standard .NET assemblies**: `System`, `System.Collections.Generic`, `System.Configuration`, `System.Data`, `System.Linq`, `System.Threading.Tasks`
### What depends on this module:
- **Unclear from source alone** — The module appears to be invoked by an installer (suggested

View File

@@ -0,0 +1,41 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/OpenFolder/Properties/Settings.Designer.cs
- DataPRO/Modules/InstallerCustomActions/OpenFolder/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/OpenFolder/Properties/Resources.Designer.cs
generated_at: "2026-04-17T16:12:01.658034+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a01c6cbb539c87e6"
---
# Properties
### Purpose
This module provides the build configuration and resource infrastructure for the `OpenFolder` installer custom action. It exists to support the assembly with application settings and resource management capabilities. The module contains auto-generated designer files for settings and resources, along with assembly metadata, but defines no custom resources of its own.
### Public Interface
**`Settings` class** (internal sealed, partial)
- `static Settings Default { get; }` - Returns the synchronized singleton instance of application settings. Inherits from `global::System.Configuration.ApplicationSettingsBase`.
**`Resources` class** (internal sealed)
- `static ResourceManager ResourceManager { get; }` - Returns the cached `ResourceManager` instance for the `OpenFolder.Properties.Resources` resource bundle.
- `static CultureInfo Culture { get; set; }` - Gets or sets the current thread's `CurrentUICulture` for resource lookups.
### Invariants
- The `Settings` class is a thread-safe singleton via `Synchronized()`.
- The `Resources.ResourceManager` property lazily initializes exactly once.
- All classes in this module are `internal` and not accessible outside the assembly.
- No custom resource strings are defined in `Resources.Designer.cs`; the class provides only infrastructure.
### Dependencies
- **Depends on**: `System.Configuration` (for `ApplicationSettingsBase`), `System.Resources` (for `ResourceManager`), `System.Globalization` (for `CultureInfo`), `System.Windows` (for WPF theme support via `ThemeInfo` attribute).
- **Depended on by**: The parent `OpenFolder` assembly and any code within that assembly requiring access to settings or localized resources.
### Gotchas
- The `Settings.Designer.cs` and `Resources.Designer.cs` files are auto-generated by Visual Studio tools. Manual changes will be overwritten on regeneration.
- The `Resources` class exposes no custom string properties, suggesting either the module doesn't require localization or resources are defined elsewhere.
- The `AssemblyInfo.cs` has an empty `AssemblyDescription` and `AssemblyCompany`, which may need to be populated for production builds.
---

View File

@@ -0,0 +1,71 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/RegAddProductCode/AddProductCode.cs
generated_at: "2026-04-17T16:46:50.881996+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5cf0f99b67b34e4b"
---
# Documentation: RegAddProductCode Module
## 1. Purpose
This module is a Windows Installer custom action that validates architecture compatibility between the installer and the operating system, then configures Windows Registry settings to add the DataPRO product code to the Secure Repair Whitelist. It exists to prevent mismatched architecture installations (e.g., 32-bit installer on 64-bit OS) and to ensure the Windows Installer service permits DataPRO installation by configuring the `SecureRepairPolicy` and whitelist entries under `HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer`.
---
## 2. Public Interface
### `static int Main(string[] args)`
**Signature:** `static int Main(string[] args)`
**Behavior:** Entry point for the custom action. Accepts a single command-line argument specifying the architecture version (`"x86"` or `"x64"`). Validates that the installer architecture matches the operating system architecture—returns `1` (failure) if mismatched, otherwise proceeds to call `AddCodeToRegistry()` and returns `0` on success. Logs diagnostic information to the Windows Event Log under the source `"DataPROInstaller"`.
**Return Values:**
- `0` — Success (architecture validated, registry updated)
- `1` — Failure (architecture mismatch detected)
---
### `private static string AddCodeToRegistry()`
**Signature:** `private static string AddCodeToRegistry()`
**Behavior:** Configures registry settings required for DataPRO installation. Opens `HKEY_LOCAL_MACHINE` with a 64-bit registry view, sets `SecureRepairPolicy` to `2` (DWORD) under the Installer policies key, and adds the product code GUID to the `SecureRepairWhitelist`. Creates the whitelist key if it does not exist. Returns an empty string on success, or an error message string on exception.
**Note:** This method is private and not part of the public interface.
---
## 3. Invariants
1. **Architecture Argument Requirement:** The first command-line argument (`args[0]`) must be either `"x86"` or `"x64"`. Any other value bypasses architecture validation entirely (no error is thrown for unrecognized values).
2. **Architecture Matching:**
- If `architectureVersion == "x86"` and `Environment.Is64BitOperatingSystem == true`, the process must terminate with return code `1`.
- If `architectureVersion == "x64"` and `Environment.Is64BitOperatingSystem == false`, the process must terminate with return code `1`.
3. **Registry View:** The registry is always accessed using `RegistryView.Registry64`, regardless of process bitness.
4. **Event Log Source:** All log entries are written to the event log source `"DataPROInstaller"`, which must exist or be creatable.
5. **Registry Key Existence:** The key at `Settings.Default.InstallerKey` must exist; if it does not, the method returns early with an error message and does not attempt to create it. The `SecureRepairWhitelistKey` will be created if missing.
---
## 4. Dependencies
### External Dependencies (Imports)
- `System` — Core framework types
- `System.Diagnostics``EventLog` for Windows Event Log integration
- `Microsoft.Win32``RegistryKey`, `RegistryHive`, `RegistryView`, `RegistryValueKind` for registry manipulation
- `System.Windows.Forms``MessageBox` for user-facing error dialogs
- `RegAddProductCode.Properties``Settings` class providing configuration values
### Configuration Dependencies (from `Settings.Default`)
- `Settings.Default.InstallerKey` — Registry path to the Installer policies key
- `Settings.Default.SecureRepairWhitelistKey` — Registry path to the SecureRepairWhitelist key
- `Settings.Default.SecureRepairPolicy` — Name of the secure repair policy value
- `Settings

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/RegAddProductCode/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/RegAddProductCode/Properties/Settings.Designer.cs
generated_at: "2026-04-17T16:13:20.075439+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "250803c72b83ea88"
---
# Properties
### Purpose
This module provides assembly metadata and application-scoped configuration settings for the `RegAddProductCode` custom installer action. It exists to configure Windows Installer policy-related registry operations, specifically for managing secure repair whitelisting. The settings defined here are used during installation to register product codes that allow the application to be repaired without elevated privileges.
### Public Interface
- **`Settings` class** (internal sealed, partial) - Auto-generated settings class inheriting from `System.Configuration.ApplicationSettingsBase`.
- `static Settings Default { get; }` - Returns the synchronized singleton instance of settings.
- `string InstallerKey { get; }` - Returns `"SOFTWARE\\Policies\\Microsoft\\Windows\\Installer"`. Application-scoped setting.
- `string MissingKey { get; }` - Returns `"No key at {0}"`. Format string template for missing key messages. Application-scoped setting.
- `string ProductCode { get; }` - Returns `"{C4889149-0CAF-44C1-B226-8F6E73684DF4}"`. The GUID product code for this product. Application-scoped setting.
- `string SecureRepairPolicy { get; }` - Returns `"SecureRepairPolicy"`. Application-scoped setting.
- `string SecureRepairWhitelistKey { get; }` - Returns `"SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\SecureRepairWhitelist"`. Application-scoped setting.
### Invariants
- All settings are application-scoped and read-only at runtime.
- The `ProductCode` GUID must be a valid Windows Installer product code format.
- Registry key paths use double backslash escaping for .NET string literals.
### Dependencies
- **Depends on**: `System.Configuration.ApplicationSettingsBase`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices`.
- **Depended on by**: The parent `RegAddProductCode` installer custom action module (inferred from namespace).
### Gotchas
- The `MissingKey` setting contains a format placeholder `{0}` suggesting it's intended for `string.Format()` usage, but the consuming code is not visible in this module.
- The `ProductCode` GUID `{C4889149-0CAF-44C1-B226-8F6E73684DF4}` is hardcoded; if the actual product code changes, this setting must be updated manually.
---

View File

@@ -0,0 +1,36 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/WarnWindows11/WarnWindows11.cs
generated_at: "2026-04-17T16:15:12.796756+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2c9c3764491675e8"
---
# WarnWindows11
### Purpose
This module serves as a Windows Installer custom action that detects whether the target system is running Windows 11 and displays a warning message to the user if detected. It is designed to be executed during installation to inform users of potential compatibility concerns with the Windows 11 operating system.
### Public Interface
- **`OSWarning`** (class)
- `public static void Main(string[] args)` - Entry point for the custom action. Spawns `systeminfo.exe`, captures its output, parses it line-by-line for the string "MICROSOFT WINDOWS 11" (case-insensitive), and displays a message box with the warning resource `Properties.Resources.WARNING_WINDOWS11` if detected. All exceptions are silently caught and ignored.
### Invariants
- The process `systeminfo.exe` must be available on the target system PATH.
- The resource string `Properties.Resources.WARNING_WINDOWS11` must be defined in the project's resource file.
- The method always completes without throwing exceptions to the caller (all exceptions are caught and swallowed).
### Dependencies
- **Depends on**: `System`, `System.Diagnostics`, `System.Windows` (for `MessageBox`), and project resources (`Properties.Resources`).
- **Depends on external executable**: `systeminfo.exe` (Windows system utility).
- **Depended by**: Unclear from source alone; likely invoked by an MSI installer or setup executable as a custom action.
### Gotchas
- **Silent failure**: The `catch (Exception) { }` block swallows all exceptions without logging, meaning any failure (missing `systeminfo.exe`, permission issues, resource loading errors) will fail silently.
- **Synchronous blocking**: `reader.ReadToEnd()` and `process.WaitForExit()` block the calling thread; this could cause installer UI freezes if run on the UI thread.
- **Fragile detection logic**: Detection relies on exact string matching of `systeminfo.exe` output format ("MICROSOFT WINDOWS 11"), which could break if Microsoft changes the output format.
- **No exit code handling**: The process exit code is not checked; `systeminfo.exe` could fail and the code would not detect it.
---

View File

@@ -0,0 +1,42 @@
---
source_files:
- DataPRO/Modules/InstallerCustomActions/WarnWindows11/Properties/Settings.Designer.cs
- DataPRO/Modules/InstallerCustomActions/WarnWindows11/Properties/AssemblyInfo.cs
- DataPRO/Modules/InstallerCustomActions/WarnWindows11/Properties/Resources.Designer.cs
generated_at: "2026-04-17T16:12:01.654860+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "644d433cfac6866f"
---
# Properties
### Purpose
This module provides the build configuration and localized resources for the `WarnWindows11` installer custom action. It exists to surface a Windows 11 compatibility warning to users during installation, specifically regarding Microsoft SQL Server installation requirements on Windows 11. The module contains auto-generated designer files for application settings and resources, along with assembly metadata.
### Public Interface
**`Settings` class** (internal sealed, partial)
- `static Settings Default { get; }` - Returns the synchronized singleton instance of application settings. Inherits from `global::System.Configuration.ApplicationSettingsBase`.
**`Resources` class** (internal sealed)
- `static ResourceManager ResourceManager { get; }` - Returns the cached `ResourceManager` instance for the `WarnWindows11.Properties.Resources` resource bundle.
- `static CultureInfo Culture { get; set; }` - Gets or sets the current thread's `CurrentUICulture` for resource lookups.
- `static string WARNING_WINDOWS11 { get; }` - Returns the localized warning message about SQL Server installation on Windows 11, referencing a Microsoft troubleshooting URL for 4KB disk sector size issues.
### Invariants
- The `Settings` class is a thread-safe singleton via `Synchronized()`.
- The `Resources.ResourceManager` property lazily initializes exactly once.
- The `WARNING_WINDOWS11` resource string must exist in the corresponding `.resx` file; otherwise, the property will return `null`.
- All classes in this module are `internal` and not accessible outside the assembly.
### Dependencies
- **Depends on**: `System.Configuration` (for `ApplicationSettingsBase`), `System.Resources` (for `ResourceManager`), `System.Globalization` (for `CultureInfo`), `System.Windows` (for WPF theme support via `ThemeInfo` attribute).
- **Depended on by**: The parent `WarnWindows11` assembly and any code within that assembly requiring access to settings or localized resources.
### Gotchas
- The `Settings.Designer.cs` and `Resources.Designer.cs` files are auto-generated by Visual Studio tools (`SettingsSingleFileGenerator` and `StronglyTypedResourceBuilder`). Manual changes will be overwritten on regeneration.
- The `WARNING_WINDOWS11` string contains a hardcoded Microsoft Learn URL; changes to the URL or documentation location would require updating the `.resx` file.
- The `AssemblyInfo.cs` has an empty `AssemblyDescription` and `AssemblyCompany`, which may need to be populated for production builds.
---