Command line arguments for some parameters - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ralienpp
Posts: 4
Joined: Mon Jan 18, 2010 4:16 pm
Contact: ICQ Website

Command line arguments for some parameters

Hello,

I am trying to use the command line interface to make some changes in the project, to automate the build process for several custom versions of the application.

The following details need to be modified:
  • Name of the output EXE bootstrap installer
  • Path to a file executed as a custom action in a post-setup event
  • Add a file to the APPDIR for some of the builds of the installer
I consulted the documentation but could not find a solution to the first 2 points. As for the last item, I am encountering the following issue.

This is what is in my BAT file

Code: Select all

"%ADVINSTPATH%\AdvancedInstaller.com" /edit \Data\sim5-clean.aip /AddFile APPDIR \fr\Data\lang.ini
I expect this will add the file \fr\Data\lang.ini to my APPDIR, but what happens in practice is this
  • The folder \APPDIR\lang.ini is created
  • lang.ini is created inside that folder

Questions:
- what am I doing wrong regarding #3?
- is it possible to modify #1 and #2 via the command line interface?
ralienpp
Posts: 4
Joined: Mon Jan 18, 2010 4:16 pm
Contact: ICQ Website

Re: Command line arguments for some parameters

A quick follow-up message. It turns out that #3 is my own mistake.

During the tests I used the following in my BAT file

Code: Select all

"%ADVINSTPATH%\AdvancedInstaller.com" /edit \Data\sim5-clean.aip /AddFile APPDIR\lang.ini \fr\Data\lang.ini
Note this part APPDIR\lang.ini, I was under the impression that I had to indicate the target file name, while in reality the file name is taken from the source. So Advanced Installer created a folder with that name, and put the file in it.

The project was saved, and afterwards, when I corrected the command line - the installer behaved counter-intuitively because I wasn't aware of the presence of APPDIR\lang.ini. I removed it and all went well.

A workaround for #1 is to add a command to the BAT file that will rename the output file to whatever I need. It is OK, but it would be better if this could be handled by Advanced Installer itself.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Command line arguments for some parameters

Hello,

For the name of the bootstrapper, you can use a pseudo-formatted property there. Something like [|OUTPUT_FILE]. You can then set that property through command line.
Launch the file using a "Launch File or Open URL" custom action. Use a MSI property in the command line field, and set that through the command line. Note it is a normal property, not a pseudo-formatted one.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ralienpp
Posts: 4
Joined: Mon Jan 18, 2010 4:16 pm
Contact: ICQ Website

Re: Command line arguments for some parameters

Gabriel, thanks for the feedback.

I got the idea, but I bumped into some issues:
I want to show a readme file after the installation, its name can be readme_en.txt, readme_fr.txt, etc. I created a custom property and called it MY_LANG, the default value is "EN".

Currently the command line for the custom action is

Code: Select all

[#readme_en.txt]
I should change it to

Code: Select all

[#readme_[MY_LANG].txt]
but the parser does not accept it.

When I try to build the project I see the following error

Code: Select all

Exception - Invalid MSI identifier string [.txt].
Seeing that there is a '#' character in the first part of the string, I tried this:

Code: Select all

[#readme_][DK_LANG][#.txt]
But the result is the same.


A similar problem happens with a shortcut (to the program's manual). The shortcut target path should be Manual_EN.chm, Manual_FR.chm, etc.

So I was thinking about something like this

Code: Select all

[#manual_[MY_LANG].chm]
But the edit box in which I write this is read-only.

Note: the program's installer exists in several flavours (English, French), it is distributed with manuals for each supported language, but by default the shortcut in the Start menu will point to the manual in the language that is assigned to this particular build. For example, If I ran the French installer, the shortcut and the readme will be in French, but the user can switch the program's language in the interface and then, the program itself will use the files that correspond to the newly selected language.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Command line arguments for some parameters

Hello,

For localizing the readme, please consult our guide on localizing the EULA and README text.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ralienpp
Posts: 4
Joined: Mon Jan 18, 2010 4:16 pm
Contact: ICQ Website

Re: Command line arguments for some parameters

The tutorial is clear, but it does not apply to my case.

In the installer, the 'show readme' functionality is implemented as a checkbox in ExitDialog, which if checked, will open APPDIR\readme_en.txt.

I learned how to localize the string 'view readme', but did not find a way to change the path to the file that needs to be open.

The same applies to the shortcut I am trying to create.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Command line arguments for some parameters

Hello,

Attached is a sample project that implements this.
It contains:
- a UI custom action
- a control on the ExitDlg
- 2 xml files for english and french READMEs
- updater.exe used as a dummy file so the project does not depend on any external files.

Regards,
Gabriel
Attachments
ConditionalReadmeSample.aip
(13.6 KiB) Downloaded 415 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”