Run Batchfile after installation problem - Advanced Installer Community
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Run Batchfile after installation problem

Hi,

I have just bought AI pro, and are working on some SILENT simple packages where the overall process in AI is the same. I need to install a existing program, and then change/add some things, which is the problem.

The progress i made sofar (Example is with IBM Iseries Access):

1) Insert default programfiles in a temp folder like "Windows volume - Temporary". Temp would be the best, since the files are only to be installed and must be deleted after installation.
2) Set ”Limit to basic userinterface” in install parameters.
3) Set ”Single MSI (Resources inside” in Media tab, since the output MUST be in 1 MSI due to management and rollout.
4) Call the setup.exe from ”Custom Actions” where i choose ”Launce installed file” and choose the ”setup.exe” in the temp folder i just added and set the executiontime to ”When the system is being modified”. The custom action is now below the Add Resources in the install execution stage.

I have done this with IBM Iseries Access software and i can save, build and run the MSI file just fine.
The single MSI file installes the ISeries Access so thats fine, but now to the problem.

I encounter are continueiung problem when i want to CHANGE or ADD a action.

I now need to run a homemade BAT file, which copies some links to the userdesktop etc.
If i run the bat manually, it works.

But i cant figure out how to EMBED this batfile into the existing project and get it to build and run.
I keep getting an error, which says ”The package has an error

I have tried the following forumthread descriptions without any luck:

http://www.advancedinstaller.com/user-g ... -file.html
http://www.advancedinstaller.com/user-g ... ation.html

I am sure, it just a matter of getting the order or process done correctly but i am pretty stuck now. 
So i need help with this, since i need to make several packages with the same setup.
Program install and then change thorugh batfile.

I will gladly upload the ”IBM Iseries access” DVD and my batfile to a sharesite, if anyone could make me an example of what the project should look like???

I have attached the error i recieve when i try to build the project, if this clears anything out.

Please help, thx.
Best regards
Brian Petersen
Attachments
Error shown
Error shown
Error.jpg (88.57 KiB) Viewed 17011 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian and welcome to Advanced Installer forums.
I need to install a existing program, and then change/add some things, which is the problem.
I'm afraid I don't fully understand very well what is your scenario and what do you want to change after installation. Can you please give us more details (maybe exemplify)?
I now need to run a homemade BAT file, which copies some links to the userdesktop etc.
If i run the bat manually, it works.
Can you please also explain what do you try to achieve through this BAT file, so we can better understand your scenario?
I have attached the error i recieve when i try to build the project, if this clears anything out.
In the attached image, I can see that you try to launch an EXE file through a custom action. Does that file works well outside the package? Also, does it requires elevation? Can you please send us the verbose log of the installation to support at advancedinstaller dot com so we can investigate it?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi Eusebiu,

Ok, i will describe the problem i encounter again, and also try to describe what process i am trying to work out.

Scenario:

I have a softwarefolder with iSeries Access program from IBM, which can be manually installed with installshield GUI, by the setup.exe
I also made a batch file, which makes some shortcuts etc, to get the IBM client to work from the desktop.

If i run setup.exe manually in windows, go through the next-next and install it, and then afterwards run the batch file, it ALL works perfect.
Iseries Access are installed, and the batchfile does what it is suppossed.

The next step is:

I now need to make an MSI package, which does all the work for me. It must contain the Iseries Access folder, batch file, and the package needs to be silent
and the output MSI result package must be in ONE single MSI file, due to distribution.

So my questions for this is:

1) Where do i place the Iseries access software folder for it to be temporaly? (I presume "Windows Volume – Temporary) the one to use?
2) Where do i place the batchfile to be executed AFTER the install of the ISeries software?
3) Where and with what choices to i tricker the setup.exe to be runned silent?
4) and where and with what parameteres do i tricker the batchfile to be executed, after the setup.exe has finished?

The above scenario is what fails for me, and i cant figure out where the errors are located.
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi again,

I am about to give up on this, unless i get help finding my beginner bugs...
I can simplify the problem now to this below, which i cant get to work either. I get the same error.

It is plain am simple.

Scenario:

1) I add a software folder with Iseries Access (Software working fine) to the "Windows Volume - Temporary" folder.
I build and run and the folder is installed in the C:\Users\%username%\AppData\Local\Temp\Image64a x64\
If i now RUN the setup in this created folder, and install manually it works, so far so god.

2) I now want advanced installer to call the setup.exe in this folder as a custom action.
I tried multiple choices at the "Custom actions" and no one is working.

Could you tell me how to set this up?

I have attached one of many custom actions allready tried and the concurrent error i receive.
Attachments
concurrent error.jpg
concurrent error.jpg (22.39 KiB) Viewed 16996 times
errorstatus.jpg
errorstatus.jpg (155.03 KiB) Viewed 16996 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian,

Please keep in mind that two MSI packages cannot run at the same time (in your case it is the main package and the "setup.exe" package). Every time you want to embed an MSI-based package into another MSI package, you should use the Prerequisites feature. For more details about how to add a prerequisite in your package you can take a look on the Add Prerequisite tutorial.

So, for your specific scenario, you can go in the Prerequisites page, add the "setup.exe" file in the "Feature-based" folder, then go in the "Setup Files" tab of your prerequisite and write the "/qn" argument in all three "Install Command Lines" fields. In this case you don't need to add the "setup.exe" file in a temporary folder because it will be embedded in the main MSI package.

However, please keep in mind that as mentioned at the bottom of the Prerequisite Setup Files Tab article, if the Professional version of Advanced Installer is used, a prerequisite can be installed in silent mode only if the main package is installed with Full UI, otherwise you will need an Enterprise or Architect version.

Just let us know if you have any other question.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Ok thx, i will try this and get back to you... but let me ask..I have a pro license

If i have a software package with lets say 210 folders and 232 files (Like for example office 2010) which i then run setup.exe to install manually, and this setup.exe actually calls a MSI package
then i can not embed the entire software package into a MSI wrapper, so i end up with ONE MSI file, which contains and installs the entire installation?

I also understand your reply as i need a enterprise license to wrap lets say 4 MSI files in 1 MSI file, with an execution order?

If this is the case, i cant see what a pro license is used for, since i need these things...
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian,
If i have a software package with lets say 210 folders and 232 files (Like for example office 2010) which i then run setup.exe to install manually, and this setup.exe actually calls a MSI package then i can not embed the entire software package into a MSI wrapper, so i end up with ONE MSI file, which contains and installs the entire installation?
Yes, you can embed any application into a MSI wrapper, it does not matter how many files it contains and how large is it.
I also understand your reply as i need a enterprise license to wrap lets say 4 MSI files in 1 MSI file, with an execution order?
No, you can embed as many MSI files as you want in a single MSI file using the Professional version that you are using. The only limitation is that if the main package is installed with Basic UI or in silent mode, the prerequisites and all their command lines will be ignored.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi Eusebiu, and thx for the replies sofar.

I been thinking about how to set up the packages i need to make and if i could get an example done
it would be SO much easier to understand, because the way i must get it to work are quite the same procedure.

Example:

1) I have a standard software folder with lets say photoshop, which contain files, msi-files and a setup.exe.
2) I then made a batchfile, which calls the setup.exe (or MSI.file) with parameters.

This works fine, as long as i run the batchfile manually, but i need this to be wrapped into ONE MSI file with the installationfiles to be temporary installed!.

The above procedure is in overall ALL i need to know how to setup in advanced installer, but i failed sofar.
All the different choices of parameters really confuses me at this point.

As i understand it sofar, the batchfile needs to be a prerequisite file, before the above scenario is possible to get to work, but i dont understand how i set this up. :/

I have uploaded one of my projects, which is IBM iSeries Access, to this download share:

https://dfbrianpetersen.sharefile.com/d ... a2c574df59

Packed in .zip and containing the batch file called ” Iseries_Access_install.bat” which contains the following code: setup /l"1030" /s /v"/qn ADDLOCAL=req,dir,dt,dtexcel,emu,ssl /norestart"

The way it should work is the software folder must be installed/copied to a TEMP folder, and then the batch file must be executed and install the software and then the TEMP must be deleted again, if this is possible…

Could you make an example MSI for me on this package that shows where and how things are to be setup?
Then i would understand it much better… I will gladly pay a small fee as a token of appreciation.

Best regards
Brian Petersen
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian,

I created an AIP (project file) and also an MSI package and uploaded them to the following link so you can take a look of them:
https://www.dropbox.com/s/lnaqzk7hfvlct ... taller.zip

However, there are two scenarios for your case and I was not really sure which one of them you need:
- the MSI wrapper will be installed with Basic UI or in silent mode (this requires an Enterprise version)
- the MSI wrapper will be installed with Full UI

I implemented the second scenario (Full UI) as described below:
- go in the Prerequisites page, right-click on the "Feature-based" folder and choose the “New Package Prerequisite” option
- select the "setup.exe" file from the resources that you sent me
- go in the "Setup Files" tab of the prerequisite, click on the [Add Folder...] button from the "Additional Files" section and choose the "Image64a x64" folder that contains all the resources
- in the "Full UI" command line field write the command line from your batchfile, except the "setup" word from the beginning
- build and run the project

If you want to install the MSI wrapper with Basic UI or in silent mode, please let me know so I can try to find a workaround for that case too, but some limitations might be encountered using the Professional version.

Also, if you want to share some private information you can send us an email to support at advancedinstaller dot com.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi Eusebio,

Great... Thank you ... I been looking at the aip file, and now i see the idea of the prerequisite...
The MSI file installs a working code, so thats perfect... but... yes, as you mentioned the problem is that it has to be silent... and not show the GUI.

Are there any way of getting the MSI to be silent? otherwise i cant se the pro version i just bought... :/

Thx in advance.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian,

In order to be able to also install the MSI wrapper in silent mode, you can follow the steps below:
- go in the Product Details page and uncheck the "Register product with Windows Installer" option (the MSI wrapper will not be displayed in Control Paned->Programs and Features list)
- go in the Files and Folders page and add all the resources from the "Image64a x64" folder
- 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: [#Iseries_Access_install.bat]
    Command Line: "[APPDIR]"
    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 you want the resources to be deleted from the machine after the installation you can add the following line in your BAT file (I added this line in my tests):

Code: Select all

rmdir /q /s %1
I also created an AIP (project file) and an MSI package and uploaded them to the following link so you can take a look of them:
https://www.dropbox.com/s/thm3a7ar0qfnd ... silent.zip

Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi Eusebio,

I didnt see your reply before now, so sorry for the delay.
Do you mean do the changes on the existing wrapper MSI? or on a NEW projectfile?

I will go through your example project now and see what it contains,

Thx alot in advance.
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi,

I runned your example project and i can see that the files in "files and folders" are missing i think.
If i run the MSI you made in this example 2, i still get the "next next" dialog...

Howcome?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run Batchfile after installation problem

Hi Brian,
I runned your example project and i can see that the files in "files and folders" are missing i think.
Yes, the files are missing because the project does not find them on your machine in the same location as they were found on my machine (D:\Image64a x64\), but you can change their location or add them again in the project if you want to build the package.
If i run the MSI you made in this example 2, i still get the "next next" dialog...
Yes, the displayed dialogs are related to the MSI wrapper, but the prerequisite is installed in silent mode.

Please keep in mind that an MSI package cannot run in silent mode by default (when you double-click it). It should be launched from an elevated console or by an EXE Bootstrapper or deployed through GPO, for example. So, if you want to have an EXE package type, then that EXE can launch the MSI wrapper in silent mode.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run Batchfile after installation problem

Hi,

Ok i see. But then i cant make the entire installation work with 1 click install, or?
The overall issue is not getting the files and programs installed... i can do this in steps with the current version
but the issue is having the installation made with just 1 click.

I have a portal which users can click a link to install, and my final goal is to make this automated..
So nothing else is needed than just clicking the link in a browser and chosse "run" .. then the entire program is installed..

But if the wrapper or files need user intervention, this scenario cant be done i presume?

Return to “Building Installers”