joster
Posts: 2
Joined: Sun Jun 25, 2017 2:07 pm

Need help building a command line or batch file

I have an .exe installer built successfully, that I need to kick off with a script when someone places an order (in WHMCS) from us.

I need to change the source directory of one included file, and the output destination of the .exe to that same, variable determined subdirectory.

Having trouble figuring out how to do that...

Customer ID '30' would pull in a config file from \installers\30\config.txt and output the installer to \installers\30\installer.exe
Customer ID '31' would pull in a config file from \installers\31\config.txt and output the installer to \installers\31\installer.exe

So I imagine:

Customer ID '%id%' would pull in a config file from \installers\%id%\config.txt and output the installer to \installers\%id%\installer.exe


So I need to change one Included File and Build output locations to a variable-supplied location. Make sense?

Can anyone help? I'm sure it's easy, I'm just not much of a programmer.....

THANKS!

Joe
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Need help building a command line or batch file

Hello Joe and welcome to our forums,

Your scenario could be implemented by the following method:

- Go to "Install Parameters" page and create a new property named ID with the default value 1.
- Go to "Builds" page and choose an EXE package type. Then enter "c:\installers\[|ID]" in the Output Folder field.

For the second part of your scenario, adding a specific file to your project depending of user ID you could use our Working with Advanced Installer from the Command Line feature.

You could create a batch file having the customer ID as a parameter, containing the following commands:
- set the ID property: Set Property Command Option
- add the config file to your project: Add File Command Option
- build the project

In this way whenever a customer places an order you could run the batch with the customers ID parameter and create the custom build.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
joster
Posts: 2
Joined: Sun Jun 25, 2017 2:07 pm

Re: Need help building a command line or batch file

Sorin,

Thanks for your help here. I'll try this tomorrow, but it cleared up a lot for me!
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Need help building a command line or batch file

Hello,

You are welcome!

Please let me know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”