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!

aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Launch a bat file after/in the installation

Hello Support!

Two question here.

I am now facing an issue. I just creating a msi package which is including a folder, the installation require to call a bat file as administrator to finish the installation.

I followed the site document tutorial here - http://www.advancedinstaller.com/user-g ... -file.html

Added the installation folder and custom action to launch the bat file after the installation. But the execution is failure with the error 3 said

"Server returned unexpected error 3 attempting to install package - C:\path to msi"

Otherwise, i want to make the msi as slient automatic install, is it possible?

Could someone give me some advice? thanks a lot for your help.

my installation folder content is attached on the post.
Attachments
_20160817150916.png
_20160817150916.png (15.15 KiB) Viewed 14457 times
aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Re: Launch a bat file after/in the installation

My desire process :

1. Make the folder as a MSI extracting the folder to the user PC

2. In / After the installer, the package auto run the bat file called "install.bat" and run as administrator

3. Silent and automatic install

How to config in the Advanced installer Please help :(
aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Re: Launch a bat file after/in the installation

New Update

I have modified the sequence, i tried put the launch file after the installation, that is what i want but fail
Attachments
60817162752.png
60817162752.png (62.89 KiB) Viewed 14451 times
817162852.png
817162852.png (26.63 KiB) Viewed 14451 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch a bat file after/in the installation

Hello and welcome to Advanced Installer forums.

I'm not sure why your custom action throws those errors. Can you perform the steps below and see if it works?
- go in the Custom Actions page, add a "Launch File" custom action right above the "Finish Dialog Stage" section with the following configuration:
  • File To Launch: [#YourFile.bat]
    Command Line: "<your_command>"
    Working Directory: [APPDIR]
    Check "Hide program's window" option
    (the CMD window will not be displayed when the BAT file will be executed)
    Uncheck the "Wait for custom action to finish before proceeding" and "Wait for return code at the end of the sequence" options
    Execution Stage Condition: check only "Install"
-build and run the project

If the problem persists please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Re: Launch a bat file after/in the installation

Hello! Thank you for your advice.

i followed your instruction, but i cannot test it.

Firstly, in the command line option, did you want me to insert the cmd command here? but all the command is already setup in the bat file.

The other part is the execution stage condition, i cannot put check only "Install" on this column. It said "The condition is invalid, Invalid operator at position 6."

i can share my aip and the application folder for you to test

My object is to extract the application folder to the user PC and call the bat file as administrator to run the following command:
C:\Program Files\PasswordServiceManager\PMPAgent\AgentInstaller.exe stop
C:\Program Files\PasswordServiceManager\PMPAgent\AgentInstaller.exe start

It is very simple.

Thank you Eusebiu!
Attachments
PMPAgent.rar
Application Folder
(566.21 KiB) Downloaded 387 times
PMPAgent.aip
(13.62 KiB) Downloaded 439 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch a bat file after/in the installation

Hello,

The problem appeared because the path to the "AgentInstaller.exe" file contains spaces and it should be enclosed into double quotes when sent through command line. Also, on a 64-bit machine the package is installed under the "Program Files (x86)" folder, not the "Program Files" folder, that is why it is not recommended to use hard-coded paths. After some investigations I modified your BAT file and configures the "Launch file" custom action as you can see in the attached archive.

Just let me know if you encounter any other problem.

Best regards,
Eusebiu
Attachments
PMPAgent.zip
(692.9 KiB) Downloaded 601 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Re: Launch a bat file after/in the installation

Dear Eusebiu,

Finally it works.

But can i make it install automatically? (Slient mode)
The user without to click the next button till the installation end?

Anyway, i am really appreciate for your help.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch a bat file after/in the installation

Hello,

In order to install the package in silent mode you need to run it from an elevated command prompt with the "/qn" switch as in the example below:
  • msiexec /i yourPackage.msi /qn
If you only want to install it with Basic UI you can go in the "Install Parameters" page and check the "Limit to basic user interface (simple progress and error handling)" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aina1228
Posts: 6
Joined: Wed Aug 17, 2016 7:59 am

Re: Launch a bat file after/in the installation

That is perfect! I can go vocation now! :D :D :D :D
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch a bat file after/in the installation

I'm glad I could help.

Have a great holiday,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”