Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How to determine the installation directory in a setup project...

How to determine the installation directory in a setup project...

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpvisual-studiowindows-admintutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fredy
    wrote on last edited by
    #1

    Hi I have just finished my first .Net application and am now trying to create a setup project using the VS .net feature. In the setup I should create some new Registry entries on the target machine which have the installation directory in its value. My question now is: How can I determine, on which directory the application has been installed? And how can I write then this value into the registry key? I tried it with the variable "ARPINSTALLLOCATION", but this variable was empty. Thanks and regards Fredy

    R 1 Reply Last reply
    0
    • F Fredy

      Hi I have just finished my first .Net application and am now trying to create a setup project using the VS .net feature. In the setup I should create some new Registry entries on the target machine which have the installation directory in its value. My question now is: How can I determine, on which directory the application has been installed? And how can I write then this value into the registry key? I tried it with the variable "ARPINSTALLLOCATION", but this variable was empty. Thanks and regards Fredy

      R Offline
      R Offline
      rwestgraham
      wrote on last edited by
      #2

      As long as you know how to create the Registry keys in the VS IDE you are in good shape. Create the key, create the value name and then set the value to: [TARGETDIR] [TARGETDIR] will be replavced by the app folder. You can also combine [TARGETDIR] with other strings. You need to be aware that [TARGETDIR] will be replaced by the app install folder with the trailing \ appended. So, say you want to store the path to your application, for example "MyApp.EXE". Set the value to: [TARGETDIR]MyApp.EXE Suppose you user installs to "C:\Program Files\Some Application\". If you create a reg key/value and set the value in your setup to: [TARGETDIR]MyApp.EXE then after the setup has run the value will be: "C:\Program Files\Some Application\MyApp.EXE" Do NOT do this: [TARGETDIR]\MyApp.EXE This will write a value to the registry as: "C:\Program Files\Some Application**\\**MyApp.EXE" Robert

      F 1 Reply Last reply
      0
      • R rwestgraham

        As long as you know how to create the Registry keys in the VS IDE you are in good shape. Create the key, create the value name and then set the value to: [TARGETDIR] [TARGETDIR] will be replavced by the app folder. You can also combine [TARGETDIR] with other strings. You need to be aware that [TARGETDIR] will be replaced by the app install folder with the trailing \ appended. So, say you want to store the path to your application, for example "MyApp.EXE". Set the value to: [TARGETDIR]MyApp.EXE Suppose you user installs to "C:\Program Files\Some Application\". If you create a reg key/value and set the value in your setup to: [TARGETDIR]MyApp.EXE then after the setup has run the value will be: "C:\Program Files\Some Application\MyApp.EXE" Do NOT do this: [TARGETDIR]\MyApp.EXE This will write a value to the registry as: "C:\Program Files\Some Application**\\**MyApp.EXE" Robert

        F Offline
        F Offline
        Fredy
        wrote on last edited by
        #3

        Hi Robert Thanks alot for your help. I'll try this as soon as possible. Regards Fredy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups