Solved

visual studio installer question - env variables

Posted on 2002-04-13
4
300 Views
Last Modified: 2013-11-20
Hi All,
I am creating a setup program using visual studio installer. I want to set one registry key value as the path of installed app, i.e, Install Directory\\App.exe
The install directory can be anything as selected by user while  installation. I tried to set key value as
%TARGETDIR%\\App.exe, and %Application Folder%\\App.exe but both actually save the same string in registry. I was expecting %TARGETDIR% or %Application Folder% will be replaced by actual path. Can somebody please help to dynamically set the actual path in registry key?

Expecting your comments/suggestions/solution.


-Britney
0
Comment
Question by:britney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:manojbkumar
ID: 6941068
Declare a STRING type variable.
STRING strAppPath;


//////////////////
strAppPath =TARGETDIR+"\\MyExe.exe";

///////////////

and then write to registry


Hope this helps
0
 

Author Comment

by:britney
ID: 6942757
Hi manojbkumar,
I think you have not understood my real problem. Firstly, I don't know in which environmental variable installer stores the actual installation path. Secondly, I have no means of string declaration and assignment. On command prompt, we can do path=%path%"my path" to concatenate "my path" to existing path variable. Same way, I want to concatenate "\\app.exe" to target dir variable and assign it to registry key as such. No second variable in picture.
I hope I am clear enough in my requirement.
0
 
LVL 1

Accepted Solution

by:
jadhaol earned 150 total points
ID: 6953475
Hi britney,
in the value of reg key, write the  following:
[TARGETDIR]App.exe
Please note the absence of '\' between TARGETDIR and App.exe.
This will replace the [TARGETDIR] with actual installation path.
0
 

Author Comment

by:britney
ID: 6954421
thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question