Solved

visual studio installer question - env variables

Posted on 2002-04-13
4
285 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 28
Generic progress indicator 6 113
Expand data scrubbing tool 13 32
How to convert MFC::CString to UTF8 wchar_t* 10 137
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

943 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

6 Experts available now in Live!

Get 1:1 Help Now