how to specify install or target directory in Install Wizard

J

JohnP

I am VERY new to windows installer. I am trying to create a very
simple install using the Wizard in Visual Studio. All I need to do is
copy a group of files to a directory and then run one exe from the
install directory. The exe takes the INSTALL directory as a parameter.
When I create a custom action in the custom action properties dialog I
do not know how to specify the installed or target directory. I tried
"[TARGETDIR]" thinking that would get me somewhere but no such luck.


so.....

if someone could lend me a hand I would greatly appreciate the help,


John
 
P

Phil Wilson

There isn't way to do this with the VS IDE, and there's no support for the
CustomActionData property for executables. I am sure it is pretty
straightforward for a program to find where it's running from. What type of
program is it? Managed like C# or VB.NET or Win32?
 
J

John Prokopek

Thanks for the feedback.
Unfortunely I cannot alter the exe that is being installed and executed.
Oh well!

thanks again
john

Phil Wilson said:
There isn't way to do this with the VS IDE, and there's no support for the
CustomActionData property for executables. I am sure it is pretty
straightforward for a program to find where it's running from. What type of
program is it? Managed like C# or VB.NET or Win32?
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

JohnP said:
I am VERY new to windows installer. I am trying to create a very
simple install using the Wizard in Visual Studio. All I need to do is
copy a group of files to a directory and then run one exe from the
install directory. The exe takes the INSTALL directory as a parameter.
When I create a custom action in the custom action properties dialog I
do not know how to specify the installed or target directory. I tried
"[TARGETDIR]" thinking that would get me somewhere but no such luck.


so.....

if someone could lend me a hand I would greatly appreciate the help,


John
 
P

Phil Wilson

You could do it with a VBScript custom action. You'd add a VBScript CA that
uses CreateObject(Wscript.WshShell) and then uses the Run method on the
object. The destination of the program you want to run is TARGETDIR that you
pass using CustomActionData, so if you set CustomActionData in the custom
action to:

[TARGETDIR]my.exe /[TARGETDIR]

you can use that. For example, if I make a custom action that just does a
message box of property("CustomActionData") the string I see is:

C:\Program Files\Setup3\my.exe /C:\Program Files\Phil\Setup3\

You might need to refine that general idea with qwuotes around the patch
names.
--
Phil Wilson [MVP Windows Installer]
----
John Prokopek said:
Thanks for the feedback.
Unfortunely I cannot alter the exe that is being installed and executed.
Oh well!

thanks again
john

"Phil Wilson" <[email protected]> wrote in message
There isn't way to do this with the VS IDE, and there's no support for the
CustomActionData property for executables. I am sure it is pretty
straightforward for a program to find where it's running from. What type of
program is it? Managed like C# or VB.NET or Win32?
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

JohnP said:
I am VERY new to windows installer. I am trying to create a very
simple install using the Wizard in Visual Studio. All I need to do is
copy a group of files to a directory and then run one exe from the
install directory. The exe takes the INSTALL directory as a parameter.
When I create a custom action in the custom action properties dialog I
do not know how to specify the installed or target directory. I tried
"[TARGETDIR]" thinking that would get me somewhere but no such luck.


so.....

if someone could lend me a hand I would greatly appreciate the help,


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top