golf4r
Posts: 11
Joined: Tue Feb 24, 2015 11:56 pm

Use ini file with silent install

HI,

I am trying to find a solution to a problem. I have my installer completed and working perfectly but I need to have a new option.

I would need the installer to detect the presence of a install.ini file in the same directory when started... if the file is found, it would then read the values into it and use them as parameters to run the installer as silent .... the values that are usually chose by the user in ComboBox would be replaced by the values in the ini file and the same behaviours would then happen... the search and replace and service install and all the rest of the installer would work the same except it would run silently.

To be more specific, I want the installer to run silently and automatically using values in the ini file as parameters for the rest of the installation ONLY if there is a install.ini file in the same directory.. otherwise, it would be a normal install with user inputs.

Is it possible ?
Thanks
PAt
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Use ini file with silent install

Hello Pat,

To implement your specific scenario you can try to add your current setup as a feature-based prerequisite to a new project (this would be a wrapper for your current project). The wrapper project should search for the INI file (you can use the "SOURCEDIR" or the "SETUPEXEDIR" property to access the location of your INI), read the values within the INI (using INI searches) and launch the prerequisite setup accordingly with a silent or full UI command line. Also, you should uncheck the "Register product with Windows Installer" option from "Product Details" page of your wrapper.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
golf4r
Posts: 11
Joined: Tue Feb 24, 2015 11:56 pm

Re: Use ini file with silent install

Hi Daniel,

I am almost done with it , thanks for the help.

There is only one thing. SOURCEDIR or in my case SETUPEXEDIR properties are not accessible in the Search module.

When I try to search into an ini for a value with the exact path it works perfectly... but since the setup will be started from anywhere on the servers, I need to use the SETUPEXEDIR value to search for install.ini and search my values into it.

here is how it is setup and it does not work when I use the test function of the search if I put SETUPEXEDIR as Folder:

File name: install.ini
Section: CONFIG
Key: PATH
Field:0
Type: Retrieve the raw value from INI file
Folder: [SETUPEXEDIR]
Depth: 0

Is there any way I can use this property in the Search module ?

Thanks
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Use ini file with silent install

Hello,

I'm not sure why this happens. I've tested the scenario in a sample, created with AI 11.9, but the search succeeded. Here it is attached.
sample.zip
(559.07 KiB) Downloaded 599 times
Let us know if this helped, otherwise please send us your .aip (project file) and the INI file you use to support at advancedinstaller dot com so we can investigate them.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
golf4r
Posts: 11
Joined: Tue Feb 24, 2015 11:56 pm

Re: Use ini file with silent install

Hey Dan,

After further tests, I realized it was only the test portion that was not working. When running for real, it was ok. Sorry about that.


I have still one last concern about this tho. I did the wrapper as you said and it works pretty fine.

When the wrapper finds install.ini , it does not run the other setup.exe ( because condition is true ). If it does not find the .ini file, then all conditions are false and it then runs the pre-requisite.

The issue is that if it runs the pre-requisite... it still runs the rest of the wrapper after and this is a very big problem since it UNDO everything the "manual" installer did...

When there is no .ini file, what needs to happen is that the manual setup needs to start ( the one with user input ) and the wrapper needs to end there... we do not want to search values into the .ini file and replace them in the config file again... it UNDO everything the manual installer does.

Do you have any idea how I could achieve this?

Thanks

PAt
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Use ini file with silent install

Hello Pat,

You should not condition the installation of your prerequisite. Your prerequisite should be always installed. You should only compute within you wrapper the command line used for your prerequisite. For example, you can use a property (SILENT_CMD) in your wrapper project in which you can store the silent command line to be used for your prerequisite. Just, go to "Custom Action" page and add a new "Set installer property" custom action with sequence, added after "Search" action group, like this:
  • Property: SILENT_CMD
    Value: <your silent command line>
    Condition: <YOUR_INI_SEARCH_PROPERTY>
Then, in the "Install Command Lines" fields, from "Prerequisite Setup Files" tab, of your prerequisite you should use the above property like this: [SILENT_CMD]

When the INI file search fails, the "SILENT_CMD" property won't be set and, therefore the prerequisite will be launched with full UI.

Let us know if this helped, otherwise please send us your .aip (project file) and give us more details about the behavior you are trying to implement.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cpatterson
Posts: 11
Joined: Tue Feb 03, 2015 3:23 pm

Re: Use ini file with silent install

Hi, Daniel, can you please save this project in AI 9.4 and upload it here? Thanks!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Use ini file with silent install

Hello,

Here it is attached.
sample_AI9.4.zip
(361.88 KiB) Downloaded 536 times
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”