?
Solved

visual studio installer question - env variables

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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‚Ķ
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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