Jump to content

All in One Launcher


Highlander

Recommended Posts

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 launcher

Launcher1.5.zip


Edited by Highlander
  • Like 1
Link to comment
Share on other sites

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

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

  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...