How to pass arguments to application - syntax - 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!

will2202
Posts: 6
Joined: Tue Jan 25, 2011 5:48 pm

How to pass arguments to application - syntax

Hi,

After installation, I want to run my application on system start up to register itself only once. The program requires command line arguments.

I have tried a long time and failed to pass command line argumentss when building an AIP, so that the installer put this command in the Registry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Myapp.exe p1 p2]

Is this possible? Please help with the correct syntax.


Regards,
William
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to pass arguments to application - syntax

Hello William and welcome to the Advanced Installer Forums,
Is this possible? Please help with the correct syntax.
Yes, it is. If by syntax you mean the Advanced Installer command line then you can use either the "New Registry Entry Command Option" or the "Add Registry Entry Command Option".
For example:
AdvancedInstaller.com /edit YourProject ... e -Data p1

If not, you can simply add or create new registry entries from the Registry page.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
will2202
Posts: 6
Joined: Tue Jan 25, 2011 5:48 pm

Re: How to pass arguments to application - syntax

mihai.petcu wrote:Hello William and welcome to the Advanced Installer Forums,
Is this possible? Please help with the correct syntax.
Yes, it is. If by syntax you mean the Advanced Installer command line then you can use either the "New Registry Entry Command Option" or the "Add Registry Entry Command Option".
For example:
AdvancedInstaller.com /edit YourProject ... e -Data p1

If not, you can simply add or create new registry entries from the Registry page.

Regards,
Mihai
Thank you very much.

May be I am not be clear in my question.
I have an entry in the Regsitry that causes Myapp to start on boot up. Myapp.exe has no argument. The Registry entry syntax in AIP is [#Myapp.exe] and it works very well.

Now I want to run another app with arguments, but only once to registry itself. When I use the "Add Value" button, it inserts the full path to Myapp2, like "C:\Program Files\MyApp\MyApp2.exe.exe -argu1 argu2". Please advise how to make an enty like [#Myapp2.exe -argu1 argu2] so that it will expand to the user install directory.

I am new to AdvancedInstaller. Thank you in advance.

Reards,
William
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to pass arguments to application - syntax

Hi William,
[#Myapp2.exe -argu1 argu2]
Simply add the arguments like this in the "Data" field like this:

Code: Select all

 [#Myapp2.exe] -argu1 argu2
The arguments should be correctly passed to the EXE.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”