cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting files during Pre-Install with InstallAnywhere

Extracting files during Pre-Install with InstallAnywhere

Summary

The ExtractToFile plugin can be used to access files from the Install task during runtime Pre-Install. The most common practice is to label the extracted file's Destination Path (in the Install task) to the "DO NOT INSTALL" Magic Folder so the INSTALLER_TEMP_DIR can be utilized for the Pre-Install plug-in's Destination.

Synopsis

In InstallAnywhere, the ExtractToFile plugin can be used to access files from the Install task during runtime Pre-Install. The most common practice is to label the extracted file's Destination Path (in the Install task) to the "DO NOT INSTALL" Magic Folder so the INSTALLER_TEMP_DIR can be utilized for the Pre-Install plug-in's Destination.

NOTE: When using Source Paths, the ExtractToFile plug-in requires the use of the InstallAnywhere variable $DOLLAR$ in place of the Source Path variable $'s to successfully resolve the Source Path via the ExtractToFile_Source variable. For information on Source Paths, please see the InstallAnywhere user's guide.


Discussion

EXAMPLE (using a Source Path variable)
Using a UNIX system (assuming the Source Path of the filename.zip file in the Install task is $DEPLOY_ZIP_PATH$/filename.zip) set the Pre-Install ExtractToFile plug-in action's variables to the following:
ExtractToFile_Source = $DOLLAR$DEPLOY_ZIP_PATH$DOLLAR$$/$filename.zip
ExtractToFile_Destination = $INSTALLER_TEMP_DIR$$/$filename.zip

Test it by adding an Execute Script/Batch File action after the ExtractToFile plug-in using the following command:

unzip "$INSTALLER_TEMP_DIR$$/$filename.zip"
The example zip file should extract as soon as the Execute Script/Batch File action performs.
EXAMPLE (not using a Source Path variable)
Using a Windows system (assuming the Source Path of the notepad.exe file in the Install task is C:\My Files\example.exe) set the Pre-Install ExtractToFile plug-in action's variables to the following:

ExtractToFile_Source = C:\My Files\example.exe
ExtractToFile_Destination = $INSTALLER_TEMP_DIR$$/$example.exe

Test it by adding an Execute Script/Batch File action after the ExtractToFile plug-in using the following command:

"$INSTALLER_TEMP_DIR$$/$example.exe"
The example binary should run as soon as the Execute Script/Batch File action performs.

Additional Information

NOTE: If all else fails, just stick the resources to extract during Pre-Install inside the ExtractToFile plug-in located in \plugins\ExtractToFile.jar. Then specify the filename in the ExtractToFile_Source field of the Plug-in.

Labels (1)
Was this article helpful? Yes No
No ratings