Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplementation methods to find DNS path via the registry #252

Conversation

LexiconCode
Copy link
Member

@LexiconCode LexiconCode commented Sep 8, 2018

Do to issues #248 with Win32_Product and wmi I have re-implemented #242 #243 methods to find DNS path via the registry.

Overview of changes

  • Does not rely on Win32_Product() from Wmi
  • Wmi dependence removed for _winreg
  • Renamed _validate_natspeak() to _validate_engine_path() as its engine agnostic
  • Renamed exe_path to engine_path for clarity
  • Renamed DisplayVersion to DnsVersion for clarity as needed
  • Edited comments for clarity

- wmi dependence removed for _winreg
- does not use Win32_Product()
- Renamed _validate_natspeak() to _validate_engine_path() as its engine agnostic
@LexiconCode LexiconCode added Enhancement Enhancement of an existing feature Testing Required Requesting testers before merge Complete Pull request is complete and tested as defined by Contributor Installation Issues and questions related to installation of Castor/Dragonfly labels Sep 8, 2018
@LexiconCode LexiconCode self-assigned this Sep 8, 2018
@LexiconCode LexiconCode added this to the v6 milestone Sep 8, 2018
@LexiconCode
Copy link
Member Author

Remove the wmi package in command prompt or windows powershell.

pip uninstall wmi

LexiconCode added 2 commits September 8, 2018 04:01
- Renamed exe_path to engine_path
- Renamed DisplayVersion to DnsVersion for clarity as needed
- Edited comments for clarity
@LexiconCode LexiconCode added WIP An work in progress and removed Complete Pull request is complete and tested as defined by Contributor labels Sep 9, 2018
@LexiconCode
Copy link
Member Author

LexiconCode commented Sep 9, 2018

As it would be helpful to try out many set ups as possible to make sure everything functions as expected. The registry can be a finicky thing. The following attachment is a reimplementation of the _find_natspeak(). For testing purposes it only prints to counsel.

Three options

  • Run _find_natspeak_test.py code in your favorite editor.
  • Download a desired location. Right-click on the Windows 10 start menu. Click on 'command prompt' or 'windows powershell' then type "python absolute-path-to-_find_natspeak_test.py" and press enter.
  • "shift right-click" In the folder containing _find_natspeak_test.py but not in or on the file/folder name and click on 'open command prompt' or 'windows powershell window here'

Example

python C:\Users\Main\Desktop_find_natspeak_test.py

The output should produce similar results

Searching Windows Registry For DNS...
Search Complete.

@mrob95
Copy link
Member

mrob95 commented Sep 9, 2018

I am still getting this error message:
err

@LexiconCode
Copy link
Member Author

Thanks for testing! I'm able to reproduce the error local variable 'Publisher' referenced before assignment on a different machine.

@LexiconCode
Copy link
Member Author

LexiconCode commented Sep 9, 2018

During QueryValue the value of a subkey for each installed program.

                DisplayName = _winreg.QueryValueEx(skey, 'DisplayName')[0]

DisplayName is undefined because of dirty registry keys or subkey does not have DisplayName string.
On my machine the first subkey parsed has all DisplayName, Publisher, DisplayVersion and InstallLocation. Therefore if software (subkey) further down on the list are missing an attribute it already contains a defined variable.

…toolbox#252

Defines object variables as not all subkeys contain an object.
@LexiconCode
Copy link
Member Author

LexiconCode commented Sep 9, 2018

The error should be fixed. It took me a while to out puzzle why it was happening in the context of the code on different machines.

_find_natspeak_test_v0.4.py.zip

@comodoro
Copy link
Contributor

It seems to be working for me (DNS 13 Home, Windows 10 Pro):

d:\temp>python _find_natspeak_test.py
Searching Windows Registry For DNS...
Search Complete.

@LexiconCode LexiconCode added Complete Pull request is complete and tested as defined by Contributor and removed WIP An work in progress labels Sep 10, 2018
@LexiconCode
Copy link
Member Author

@mrob95
Let me know if it works on your pc.

@mrob95
Copy link
Member

mrob95 commented Sep 12, 2018

Yes, working now

@LexiconCode LexiconCode merged commit d9d2975 into dictation-toolbox:develop Sep 12, 2018
@LexiconCode LexiconCode deleted the Find_DNS_path_via_the_registry branch September 12, 2018 17:21
@LexiconCode LexiconCode removed the Testing Required Requesting testers before merge label Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Pull request is complete and tested as defined by Contributor Enhancement Enhancement of an existing feature Installation Issues and questions related to installation of Castor/Dragonfly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants