patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Install folder as parameter in command line?

Hello,

I have a Setup.exe build with Advanced Installer. I don't want to let the user decide what the installation folder will be. My app will start "Setup.exe" and will add a parameter which is the Installation folder. Like this:

Setup.exe "C:\my App's folder\"

The installation folder for Setup.exe will than be "C:\my App's folder\"
How can I do this with Advanced installer?

Thanks!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hello Patrick,

Please note that the APPDIR is the public property that contains the path for the installation folder.
Please take a look on our Properties article which may be useful to you. Please keep in mind that this property is referenced by formatted data type so it is resolved at runtime.

In order to change the value of APPDIR property you can use the /SetAppdir command line option.

Please note that the user can change the value of APPDIR during the installation in the FolderDlg dialog install sequence. So, if you don't want the user to change the installation path, you can go in the Dialogs page, select the “FolderDlg” and delete it using the Delete toolbar button.

Also, can you please give us more details about your specific scenario and maybe I will be able to suggest the most suitable approach?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Hello Dan,

Thank you for your reply.
Dan wrote:Please note that the APPDIR is the public property that contains the path for the installation folder.
Please take a look on our Properties article which may be useful to you. Please keep in mind that this property is referenced by formatted data type so it is resolved at runtime.
Ok, but this command line property can only be used BUILDING Setup.exe right?

I need a command line option for the already build Setup.exe. So, Advanced Installer builds Setup.exe for me without the "Folder Dialog" and Setup.exe needs to be started by our user with a parameter that has the value of APPDIR.

So, my user can install our build Setup.exe like this:
Setup.exe "C:\InstallHere\"

This will run Setup.exe and it will automaticaly install in C:\InstallHere\

Thanks!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hi Patrick,

In order to achieve that you can go in the "Media" page and edit the MSI Command Line: from the Bootstrapper Options pane.

Also, please keep in mind that you can specify the default path for the installation folder in the Install Parameters page in the Application Folder field.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Hello Dan,
Dan wrote:In order to achieve that you can go in the "Media" page and edit the MSI Command Line: from the Bootstrapper Options pane.
Ok, but I still don't understand what I need to enter there ;-)

So, my user types this into his command prompt:
Setup.exe "C:\myFolder\"

How do I catch the "C:\myFolder\" and how do I past that information to APPDIR so Setup.exe knows what the destination folder for the installation will be?
Dan wrote:Also, please keep in mind that you can specify the default path for the installation folder in the Install Parameters page in the Application Folder field.
Yes, but than the installation folder will be FIXED in the installers. I want that the user to type the installation folder as a parameter to the Setup.exe. Remember that "Setup.exe" is the setup installation build by Advanced Installer.

Thank you!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hi Patrick,

In order to achieve that you can use a Set public property command line option. The name of a public property contains only uppercase letters (for example PROPERTY). This type of properties can be set through the command line like this: PROPERTY="value". You can also take a look on the Command line article which may be useful.
Sample command line:

Code: Select all

msiexec.exe /i "C:\Example.msi" MY_PROP="myValue"
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Thank you Dan! This is getting us somewhere!

Now. This only works of we use a Setup.MSI right? Is there a way if the installer is a EXE like Setup.exe?

Thanks!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hi Patrick,

First of all I apologize I misunderstood your specific scenario, running the .EXE.
In order to use the install folder as parameter in the command line for an .EXE which is build with Advanced Installer you can use:

Code: Select all

Setup.exe APPDIR="C:\myFolder"
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Hi Dan,
Dan wrote:First of all I apologize I misunderstood your specific scenario, running the .EXE.
In order to use the install folder as parameter in the command line for an .EXE which is build with Advanced Installer you can use:

Code: Select all

Setup.exe APPDIR="C:\myFolder"
EXACTLY what I need! Thanks! ;-)

Patrick
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Hi Dan,

One more question.

Is there also a command line option to SKIP the dialog screen:
http://dl.dropbox.com/u/390763/Screensh ... 0_1753.png

This way I only need to build ONE installer which can be used with or without the APPDIR command line option.

Thanks!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hi Patrick,

In order to achieve that you can Show a dialog conditionally. For that, please select the related dialog that you want to condition it and select the "Show only if.." option from the right click menu options and give an appropriate name (e.g. SKIP_DIALOG).

If you want to skip the related dialog you should use a condition like this:

Code: Select all

NOT SKIP_DIALOG
So, when the SKIP_DIALOG property is set in the command line then the related dialog will not be shown, otherwise it will be displayed.
Your command line can look like this:

Code: Select all

Setup.exe APPDIR="C:\myFolder" SKIP_DIALOG="true"
Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
patrickmast
Posts: 25
Joined: Fri Apr 17, 2009 4:16 pm

Re: Install folder as parameter in command line?

Hey Dan,

That would be GREAT!! ;-)

Only.. The "Show if.." is grayed out in my project:
Image

How can I enable it?

I have Advanced Installer Enterprise version 10.0 build 50412

Thanks!

Patrick
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install folder as parameter in command line?

Hi Patrick,

This is happening because the “FolderDlg” is a mandatory dialog in your chain sequence.
Please keep in mind that each theme comes with its own recommended default dialogs. Default dialogs can be removed, but each sequence must have at least a dialog left in its chain.

You probably deleted the “WelcomeDlg”. If you use the [ Add Dialog] toolbar button from the dialogs page and add once again the “WelcomeDlg” you can see that you can condition the “FolderDlg” appearance.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”