Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting files at the start up setup instead of the end

I am using the latest version of inno that does the following during setup:

  1. Perform dependency check to see what is installed
  2. Installs dependencies that are not already installed (.net, sql server, directx etc)
  3. Install the application and the files from the [Files] section (wpReady)
  4. Checks SQL Server for previously installed database and creates / updates the tables etc

Step [4] creates the database and tables etc and only works if SQL Server has already been installed which is why it is done in Step [2].

The output directory contains the created setup.exe and I manually place the additional dependencies folder containing the files required for steps [1,2 and 4] mentioned above.

This works great but I would like to create a single exe only that includes all the dependencies and extracts the dependencies BEFORE wpReady and before Step [1] above.

The dependencies are in the [Files] section but these files are not extracted until the setup executes wpReady message after the setup has gone through all the forms and attempts to install the files.

I use the following that adds what I need to the setup.exe

[Files]
Source: Output\Dependencies\*; DestDir: {tmp}; Flags: deleteafterinstall

What is the best way to extract the files to the temp directory before wpReady or should I perform the actions of wpReady first then go about installing the Dependencies (not ideal though).

like image 448
Belliez Avatar asked Apr 28 '09 13:04

Belliez


1 Answers

You can use the ExtractTemporaryFile() function in the PrepareToInstall event function to extract any file from the [Files] section to {tmp} earlier, and it will be deleted when the setup finishes. Together with scripting and the various hooks Inno Setup gives you nearly everything can be achieved.

Have a look at the "Pascal Scripting" section of the Inno Setup help, specifically the "Support Functions Reference". There you will find documentation for ExtractTemporaryFile() and more.

like image 92
mghie Avatar answered Oct 23 '22 10:10

mghie