How to add a value to the hkey_classes_root key where the application is installed

solvable !!

I'm trying to create a custom URL protocol for my application that will launch my application when they visit or click on the link to myapp: start

My problem is how to find out where the user has installed my application. Can msi installer set location when registering HKEY_CLASSES_ROOT in the registry?

HKEY_CLASSES_ROOT
   myapp
      (Default) = "URL:myapp Protocol"
      URL Protocol = ""
      DefaultIcon
           (Default) = "myapp.exe,1"
      shell
           open
               command
                   (Default) = "C:\Program Files\MyAppFolder\MyApp.exe" "%1"

I wanted to change the path "C: \ Program Files \ MyAppFolder \ MyApp.exe" to where the user installed my application during the installation process.

Decision

HKEY_CLASSES_ROOT
   myapp
      (Default) = "URL:myapp Protocol"
      URL Protocol = ""
      DefaultIcon
           (Default) = "myapp.exe,1"
      shell
           open
               command
                   (Default) = "[TARGETDIR]MyApp.exe "%1""

[TARGETDIR] will automatically change to where the user installed the file, for example. "C: \ Program Files \ MyAppFolder \"

URI

+5
1

Visual Studio [TARGETDIR] .

, , .exe .

+3

All Articles