Roald87 / TcBlack

Opnionated code formatter for TwinCAT.
MIT License
103 stars 11 forks source link

Replace hardcoded devenv path with method to find devenv path on local system #5

Closed Roald87 closed 4 years ago

Roald87 commented 4 years ago

Currently the devenvPath is hard coded in TcProjectBuilder to the default path "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/devenv.exe" for VS2017. Would be nice to make it independent of the system and VS version.

Roald87 commented 4 years ago

Maybe with (source):

RegistryKey rkey = Registry.LocalMachine;
RegistryKey rkey1 = rkey.OpenSubKey(REGISTKEY, false);
string devenvPath = rkey1.GetValue("").ToString();