Highlander Posted June 26, 2016 Share Posted June 26, 2016 (edited) My TrackIR is not set to start when windows starts, SO... I keep forgetting to launch it when I launch DCS. I took a few days messed around with VS with C# and made a launcher that will launch TrackIR then launch DCS. I also added in a button for JSGME as well as a launch button for TrackIR and DCS 2.0 Im not a coder and not into graphic design, so its basic and not fancy. At this time it is just set for the "Stock" install locations for DCS and TrackIR. each location for the buttons are; C:/Program Files (x86)/NaturalPoint/TrackIR5/TrackIR5.exe C:/Program Files/Eagle Dynamics/DCS World 2 OpenAlpha/bin/DCS_updater.exe C:/Program Files/Eagle Dynamics/DCS World OpenBeta/bin/DCS_updater.exe C:/Program Files/Eagle Dynamics/DCS World OpenBeta/JSGME.exe - Shortcut JSGME was giving me issues so my work around was to unzip the files into the {C:/Program Files/Eagle Dynamics/DCS World OpenBeta} and then use step 3 in this post " http://forums.eagle.ru/showthread.php?t=98607 ". I moved the shortcut back into the DCS World OpenBeta folder as well. Like I said this is my first time coding, I am going too keep trying to google and find a way to configure it so the user can point each button to their own location for the exe. So far no luck, unless someone here can point me in the right direction. Anyway here is the launcherLauncher1.5.zip Edited June 26, 2016 by Highlander 1 Link to comment Share on other sites More sharing options...
AlaskanGrizzly Posted June 26, 2016 Share Posted June 26, 2016 Like I said this is my first time coding, I am going too keep trying to google and find a way to configure it so the user can point each button to their own location for the exe. So far no luck, unless someone here can point me in the right direction. An easier way would be to locate the installed program's base path by searching the registry for the uninstall key for each program. Here is the function I use for Kneeboard Builder: First declare the registry key for the uninstall key: internal static RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall"); The function for searching the registry: /// <summary> /// Return installation path to installed program .exe /// </summary> /// <param name="parentKey"></param> /// <param name="name"></param> /// <returns></returns> internal string FindByDisplayName(RegistryKey parentKey, string name) { string[] nameList = parentKey.GetSubKeyNames(); for (int i = 0; i < nameList.Length; i++) { RegistryKey regKey = parentKey.OpenSubKey(nameList[i]); try { if (regKey.GetValue("DisplayName").ToString() == name) { return regKey.GetValue("InstallLocation").ToString(); } } catch { } } return ""; } Call the function like in these examples: DCSbetaPath = FindByDisplayName(regKey, "DCS World OpenBeta"); DCSpath = FindByDisplayName(regKey, "DCS World"); Have your program look for each installation path at startup and you should be good to go. I am self taught myself but am willing to help if you have any questions. Link to comment Share on other sites More sharing options...
Highlander Posted June 26, 2016 Author Share Posted June 26, 2016 An easier way would be to locate the installed program's base path by searching the registry for the uninstall key for each program. Here is the function I use for Kneeboard Builder: Hmm ok thanks will start looking into that. Link to comment Share on other sites More sharing options...
Wrench Posted August 27, 2016 Share Posted August 27, 2016 I did the same thing with a batch file. Carrier Script. Link to comment Share on other sites More sharing options...
Recommended Posts