3.1 KiB
3.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:11:25.802939+00:00 | zai-org/GLM-5-FP8 | 1 | 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 (specificallyHKLM\Software\...Products) for installed versions of "DataPRO". Returns the subkey name of the most recent version found that is less thaninstallingVersion. Theoutparameter 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 ifleftString>rightString.bool IsLessThan(this Version leftString, Version rightString)(Extension Method): Returns true ifleftString<rightString.
Invariants:
- Registry paths are read from
Settings.Default(e.g.,RegistrySoftwareInstalledProducts,RegistryDisplayName). - The module specifically targets the
RegistryHive.LocalMachinewithRegistryView.Registry64. GetMostRecentlyInstalledSubKeyNameonly considers versions strictly less thaninstallingVersion.GetMostRecentlyInstalledPathmodifies the path string if it contains "DTSSuite", appending the DataPRO folder name.
Dependencies:
- Depends on:
SystemMicrosoft.Win32Common.Properties(forSettings.Default)System.Diagnostics(forEventLog)
- Depended on by: Installer custom actions (implied by module path).
Gotchas:
- Hardcoded Event Log Source: The method
GetMostRecentlyInstalledPathcreates anEventLogwithSource = "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 ofGetValue(...).ToString(). - Path Logic: The logic appending
Settings.Default.RegistryDataPRO + "\\"whenDTSSuiteis detected assumes a specific directory structure that may break if the suite installation layout changes. - Extension Method Scope: The
IsGreaterThanandIsLessThanextension methods are defined in a static class but are effectively utility methods forVersionobjects used within this class.