jan.schneider.hi
Posts: 5
Joined: Wed Sep 02, 2009 9:22 pm

"EXE with working Dir" and Command Line Parameter

Hi all, I'm a freshman in setup development and hope you could help me.

We developed a tool to manage the licensing processes while the setup is running. The EXE ist build in Microsoft VS2008 (NET). Cause of that the EXE will need some Resource Files run correctly and to display some informations. The resource files are placed in few subdirectories. Moreover the managing tool need some parameters on startup.

Thereby I added a Custom Action to our setup project ("Launch File or Open URL") to run the EXE and transfer the parameter by the command line. But it does't work. It can't find the resource files.

Hereafter I find the Custom Action "EXE with working Dir". But there is no "Command Line" option like in "Launch File or Open URL". Is these the right type of custom action to solve the problem? How I can transfer the parameters? We have to place the tool in the msi package (the tool may not be placed on cd oneselfe), but we don't want to install the tool on a local machine. How/Where I have to place the directories and files of the managing tool?
If there is no way to solve the problem under these handicaps, how it will work?

Due to the VS2008 the .NET Framework is needed while installation. It is possible to add loaunch condition at the prerequisites. So that the setup will only run if the .NET Framework is installed. But we want to deliver the Framework within the setup package. Is it possible to install the Framework directly at the start? How I have to check whether the framework is already installed? How I have to check the framework version?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: "EXE with working Dir" and Command Line Parameter

Hello and welcome to Advanced Installer Forums.

First of all we recommend that you read our comprehensive Tutorials,How To's and Q&As to help you get started with Advanced Installer.
Thereby I added a Custom Action to our setup project ("Launch File or Open URL") to run the EXE and transfer the parameter by the command line. But it does't work. It can't find the resource files.
This might happen due to the fact that your executable's working directory is not properly set.
Hereafter I find the Custom Action "EXE with working Dir". But there is no "Command Line" option like in "Launch File or Open URL". Is these the right type of custom action to solve the problem? How I can transfer the parameters? We have to place the tool in the msi package (the tool may not be placed on cd oneselfe), but we don't want to install the tool on a local machine. How/Where I have to place the directories and files of the managing tool?
If there is no way to solve the problem under these handicaps, how it will work?
The "Exe with working Dir" custom action is indeed the solution to your problem. You can place the command line parameters for your custom action directly in the "Full Path" field. Remember the full path should be enclosed in quotes. Since you do not want your tool to remain installed, the solution is to set it and its resources as Temporary Files.
Due to the VS2008 the .NET Framework is needed while installation. It is possible to add loaunch condition at the prerequisites. So that the setup will only run if the .NET Framework is installed. But we want to deliver the Framework within the setup package. Is it possible to install the Framework directly at the start? How I have to check whether the framework is already installed? How I have to check the framework version?
You can add the .NET Framework as a software prerequisite. For details on how to achieve this, please check this tutorial).

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jan.schneider.hi
Posts: 5
Joined: Wed Sep 02, 2009 9:22 pm

Re: "EXE with working Dir" and Command Line Parameter

Thank you for your reply.

Could you send me an example for the "Full Path" option within command line parameters?

Due to our license managing tool I will need .NET Framework during installation. A software prerequisite will install .NET at the end or will prevent the installation. Is it possible to check and install the .NET Framework automaticel before the actually setup will run?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: "EXE with working Dir" and Command Line Parameter

Hello,

Attached is the example project you requested. I hope you find it of use.
A software prerequisite will install .NET at the end or will prevent the installation. Is it possible to check and install the .NET Framework automaticel before the actually setup will run?
A software prerequisite is always installed at the beginning by the .exe bootstrapper, before your msi even has the chance to start.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jan.schneider.hi
Posts: 5
Joined: Wed Sep 02, 2009 9:22 pm

Re: "EXE with working Dir" and Command Line Parameter

Sorry, I can't find the attechment.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: "EXE with working Dir" and Command Line Parameter

Hi,

I am sorry, I forgot to post the attachment.

Regards,
Gabriel
Attachments
ExeWithWorkingDirectoryExample.zip
(166.62 KiB) Downloaded 536 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jan.schneider.hi
Posts: 5
Joined: Wed Sep 02, 2009 9:22 pm

Re: "EXE with working Dir" and Command Line Parameter

Sorry, it works only as an custum action in InstallExecuteSequence.
I atteched a new example project to show you I would like do realize it. An UI Custom Action will starts anytime during the process.
In that case it is possible to run a tool durig the setup befor the actually installation will copy the files. Therefore I will need .NET Framework already on launching the setup.
Thats the reason I have to check the .NET Framework version and perhaps install the framework at launching the installation. But the Launch Conditions will only cancel the setup I think. And the Software Prerequistes will install the files dirctly befor the actualy installation.
My way don't want to corruped the setup (link the Launsch Conditions), but I will need the license managing tool during the setup anytime(Software Prerequistes will handel the framework install to late).
Is it possible to realize like that way?
Attachments
ExeWithWorkingDirectoryExample.zip
(171.41 KiB) Downloaded 431 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: "EXE with working Dir" and Command Line Parameter

Hi
Software Prerequistes will install the files dirctly befor the actualy installation.
No, the Software Prerequisites are installed before the user interface is even displayed, before the wizard starts, before InstallUISequence even. It is the absolute first thing the bootstrapper does, you could not place your tool before this even if you wanted to.
I am not sure what you are trying to achieve. Can you give me more details?

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
e.lombardo
Posts: 5
Joined: Thu May 05, 2011 4:39 pm

Re: "EXE with working Dir" and Command Line Parameter

Hi,
i need to execute myApp (EXE with working dir) and command line parameters.
I select a path for my custom application (.NET app) with PathEdit and BrowseButton. This path must used like command line parameter.

To explain my problem, it's necessary that i use an example:

SQLENGINE_PATH: C:\Program Files\Microsoft SQL Server\ NOT WORKING!
SQLENGINE_PATH: C:\Program Files\Microsoft SQL Server WORK!!!!!!!

The problem is when i use "\" charater with command line.

I use this FULL PATH for my custom action:
"[&lgcinstallservermain.exe]" "[SQLENGINE_PATH]" "[SQLDATA_PATH]"

I need that AI manage this kind of problem, like regular expression? i don't know... I hope I've made a mistake and that solution is very easy! :P
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: "EXE with working Dir" and Command Line Parameter

Hi,

A solution is to add an extra space after the property references. This way the backslash from your path end doesn't escape the quote:

Code: Select all

"[&lgcinstallservermain.exe]" "[SQLENGINE_PATH] " "[SQLDATA_PATH] "
Another solution is to remove the backslash through a custom action before using the property.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”