5.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:00:30.279115+00:00 | zai-org/GLM-5-FP8 | 1 | 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 directoryargs[1]-productVersion: Version of DataPRO being installed (parsed asVersion)args[2]-noUI: Set to"TRUE"to suppress MessageBox outputargs[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. Setsresultto describe migration status.
3. Invariants
-
Version ordering: Migration only proceeds if
PreviousInstall.GetMostRecentlyInstalledSubKeyNamereturns a non-empty subkey (i.e., a previous version exists that is lower thaninstallingVersion). -
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
DownloadFolderspecifically: the old value must NOT equalStringResources.DataUpOneLevel(the previous default)
-
License file identification: A file is considered a valid DataPRO license if it contains both
"<License>"and"<LicenseAttributes>"substrings. -
License search depth:
FindLicenseInPathsearches up to 2 levels of subdirectories recursively. -
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 messagesInstaller.Common.PreviousInstall- ProvidesGetMostRecentlyInstalledSubKeyNameandGetMostRecentlyInstalledPathmethodsDTS.Common.Utilities.ConfigInitializationHelper- ProvidesGetNewSettingsmethodDTS.Common.Utilities.SettingElementCollection- Collection type for configuration settingsSystem.Configuration-ConfigurationManager,Configuration,ClientSettingsSection,SettingElementSystem.Windows.Forms-MessageBoxfor UI outputSystem.IO- File and directory operations
What depends on this module:
- DataPRO installer (WiX or similar) as a custom action executable
5. Gotchas
-
Inconsistent event log source: In
Main, the event log source is created as"DataPROInstaller", but inUpdateConfigurationIfPossible, theEventLog.Sourceis set to"MySource"which appears to be a bug or leftover debug code—the log entry is also commented out. -
Extensive commented-out code: Large blocks of code in
Mainare commented out, including logic for modifyingDownloadFolder,ImportArchiveFolder, andDTSPluginssettings. This may represent deprecated functionality or work-in-progress. -
Silent exception handling: The event log source creation in
Mainuses an emptycatch {}block, silently ignoring any failures (e.g., permission issues). -
Hardcoded assumption about registry paths:
GetOldSettingsconstructs the old config path by appendingStringResources.RegistryDataPROExetonextLowerPath, which assumes the previous installation follows a specific directory structure. -
License priority:
MigrateLicenseFileprioritizes 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. -
No rollback mechanism: If migration partially succeeds then fails, there is no rollback of already-written changes to the new configuration file.