Skip to content

Conversation

gbakeman
Copy link
Contributor

@gbakeman gbakeman commented Oct 23, 2022

Troubleshooting the TypeInitializationException being thrown at startup.

  • Create a subroutine to generate a nice message from exception data.
  • Call the sub to generate the initial message, then run it again if an InnerException is present.
  • Wrap getting the Reg_Key var in a Try block to catch the TypeInit error and hopefully catch the inner exception.
  • WinNUT used WMI objects to generate a hash for cryptography. Sometimes these objects were not present on the end user's system, causing an exception. WinNUT now uses the Data Protection API from the .Net Framework to provide cryptographic services.
  • Parameter saving and loading into the registry has been cleaned up and optimized.

Closes #1

Create a subrouting to generate a nice message from exception data. Call it to generate the initial message, then run it again if an InnerException is present. Also wrap getting the Reg_Key var in a Try block to catch the TypeInit error and hopefully catch the inner exception.
@gbakeman gbakeman added bug Something isn't working enhancement New feature or request labels Oct 23, 2022
@gbakeman gbakeman added this to the 2.2 Stable Release milestone Oct 23, 2022
@gbakeman gbakeman self-assigned this Oct 23, 2022
@gbakeman gbakeman linked an issue Oct 23, 2022 that may be closed by this pull request
Continue to support different paths depending on debug mode, but also handle instances where the default directory is not writable by the current user.
Allow the Logger object to be initialized, and log traces made before the ApplicationData variable is prepared. Also allow the LogTracing sub to accept a null sender.
- The custom data cryptography solution was deriving its hash values from WMI objects that may or may not be available at runtime. The entire crypto solution has been replaced in favor of the Data Protection API included in the .Net framework.
- Optimized the parameter loading and saving routines, including reducing redundant reads and writes to the registry.
- Fixed the delay value so it now initializes correctly to a proper value in milliseconds.
@gbakeman gbakeman changed the title Upgrade unhandled exception handling Upgrade unhandled exception handling, cryptography Oct 30, 2022
@gbakeman gbakeman merged commit 55cc622 into Dev-2.2 Nov 12, 2022
@gbakeman gbakeman deleted the 1-typeinitializationexception branch November 12, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to initialize crypto when ProcessorID WMI object is not available
1 participant