Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

visual studio installer question - env variables

Posted on 2002-04-13
4
Medium Priority
?
320 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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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