Solved

visual studio installer question - env variables

Posted on 2002-04-13
4
275 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
  • 2
4 Comments
 
LVL 2

Expert Comment

by:manojbkumar
Comment Utility
Declare a STRING type variable.
STRING strAppPath;


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

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

and then write to registry


Hope this helps
0
 

Author Comment

by:britney
Comment Utility
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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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 video discusses moving either the default database or any database to a new volume.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now