5.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T04:44:25.291700+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | c5bd9c265d48c4b1 |
Properties
Documentation: RegAddProductCode Module
1. Purpose
This module is a .NET-based Windows Installer custom action designed to register a product code in a specific Windows Registry location—primarily to support Windows Installer’s SecureRepairPolicy mechanism. It reads configuration settings (including registry key paths and a product code GUID) and writes the product code to the SecureRepairWhitelist registry subkey under the Windows Installer policies path. Its role is to ensure that a given product remains whitelisted for secure repair operations, a security feature introduced in Windows Installer to restrict which products may be repaired without elevated privileges.
2. Public Interface
No public executable API (e.g., CustomAction entry points) is visible in the provided source files. However, the module exposes the following configuration types and members:
-
RegAddProductCode.Properties.Settings.Default- Type:
RegAddProductCode.Properties.Settings(singleton instance) - Behavior: Provides application-scoped read-only access to configuration values defined in
Settings.settings. This is the only public surface exposed via the generated settings class.
- Type:
-
RegAddProductCode.Properties.Settings.InstallerKey- Type:
string - Default Value:
"SOFTWARE\\Policies\\Microsoft\\Windows\\Installer" - Behavior: Returns the base registry key path for Windows Installer policies.
- Type:
-
RegAddProductCode.Properties.Settings.MissingKey- Type:
string - Default Value:
"No key at {0}" - Behavior: A format string template, likely intended for logging or error messages when a registry key is not found.
- Type:
-
RegAddProductCode.Properties.Settings.ProductCode- Type:
string - Default Value:
"{C4889149-0CAF-44C1-B226-8F6E73684DF4}" - Behavior: Returns the product code GUID to be added to the whitelist.
- Type:
-
RegAddProductCode.Properties.Settings.SecureRepairPolicy- Type:
string - Default Value:
"SecureRepairPolicy" - Behavior: The name of the registry value used to enable/disable secure repair policy.
- Type:
-
RegAddProductCode.Properties.Settings.SecureRepairWhitelistKey- Type:
string - Default Value:
"SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\SecureRepairWhitelist" - Behavior: Returns the full registry path where whitelisted product codes are stored.
- Type:
Note
: The actual custom action logic (e.g.,
Install/Commit/Rollbackmethods or[CustomAction]-attributed functions) is not present in the provided files and must reside in other source files (e.g.,CustomAction.cs). This documentation is limited to what is exposed in the providedAssemblyInfo.csandSettings.Designer.cs.
3. Invariants
- The
ProductCodesetting is expected to be a valid GUID string (format{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}), though no runtime validation is evident from the settings definition. - The registry paths (
InstallerKey,SecureRepairWhitelistKey) are hardcoded and must be valid Windows Registry paths (double-escaped backslashes in source reflect single escaping in the runtime string). - Settings are application-scoped and read-only at runtime (no setters exposed); they are fixed at compile time.
- The
Settings.Defaultinstance is thread-safe viaApplicationSettingsBase.Synchronized().
4. Dependencies
- Runtime Dependencies:
System.Configuration.dll(forApplicationSettingsBase,ApplicationScopedSettingAttribute, etc.)System.dll(for core types likestring,Attribute, etc.)
- Build/Deployment Dependencies:
- This assembly is likely referenced by a Windows Installer (MSI) project or custom action project (e.g., WiX, InstallShield) as a custom action DLL.
- It depends on the Windows Installer service being available at runtime (to interact with registry policy keys).
- Inferred Consumers:
- An external installer project (e.g.,
.wixproj,.vdproj) that invokes this assembly as a custom action during installation/repair. - The
RegAddProductCodeassembly itself is not referenced programmatically by other modules in the provided source.
- An external installer project (e.g.,
5. Gotchas
- Missing Custom Action Entry Point: The provided files contain no
CustomActionmethod definitions (e.g., no[CustomAction]attributes orSession-based logic). The actual behavior (reading settings and writing to registry) is not observable here—this module’s purpose is inferred from naming and settings, but implementation details are absent. - Hardcoded Product Code: The
ProductCodeis fixed at compile time ({C4889149-0CAF-44C1-B226-8F6E73684DF4}), meaning this assembly is not reusable for other products without recompilation. - Registry Path Escaping: The
\\in string literals (e.g.,"SOFTWARE\\\\Policies...") are literal backslashes in the compiled string (due to C# escaping), which is correct for registry paths, but could be confusing if misread. - No Error Handling in Settings: The settings class provides no mechanism to validate or handle missing registry keys—error handling (e.g., for
MissingKey) must be implemented elsewhere (e.g., in the custom action logic not shown). - No Versioning Strategy: Assembly version is
1.0.0.0for bothAssemblyVersionandAssemblyFileVersion, suggesting minimal version discipline—could cause issues in side-by-side deployments. - None identified from source alone. (Additional gotchas would require inspecting the actual custom action implementation.)