cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yp_patel
Level 3

how to extract files from cab file

Hi,

I am using IS2010 - installscript based software.
I have a project which does not require uninstall - no uninstall or maitenance.

I would like to extract a file (abc_data.zip) from cab file during GUI selections scree -- pre-install.

then I would like same file (abc_data.zip) to be extracted during normal install time to it's destination folder.

I do not want to put that file (abc_data.zip) in support folder.

when I extract the file, I do not want the installer to add any registry entry regarding files/feature pulled from media/cab files..

Thanks,
Yogesh
Labels (1)
0 Kudos
(4) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

InstallScript does not provide any runtime functionality to access a file that is included in a data cab that is a part of the installation (note that MSI doesn't provide this type of functionality either).

The file would be first be accessible when the OnInstalledFile event is called with that particular file in the szFile parameter (OnInstallingFile will be called just before the file is transfered). To be able to access the file earlier than this point would require adding the file as a support file or a Disk1 file.
0 Kudos
yp_patel
Level 3

Josh,
Thanks for the reply...

But what does installshield uses to extract the files from data1.cab?

I need to call similar function during pre-install time.

I can't use featuretransfterdata(), or FeatureMoveData(), somehow these functions create a registry entry for uninstall, which I don't need to. Also I need to extract these files multiple times.

any idea?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The functionality used to extract files from InstallScript CABs is a part of the file transfer code and isn't exposed outside of the engine. Support files stored in data1.cab are extracted as a result of installing components that are generated by the build (feature transfer is used to install these components and then remove them when the setup is exiting).

Note that FeatureTransferData and FeatureMoveData do not create any registry information other than what is included in the Registry view of an InstallScript project. Any other registry information written to the machine is done through the InstallScript registry functions. For example, the uninstall key for an InstallScript project is written from the OnMoveData event by calling MaintenanceStart (this is skipped in an installation that has no uninstall or maintenance set).
0 Kudos
yp_patel
Level 3

Josh,

it does in my case.. you can try following scenario

Create a small project with one feature..
set a "Maintenance Experience" to No uninstall or maintenance.
include couple of dummy files..
build it..
-- install it.. and check you won't find registry entries for that feature..

--- then update your project ---
add featuretransfterdata(), or FeatureMoveData(), function in pre-install
put some messagebox before above function and after above function to debug
build it
-- Run installer -- not stay in pre-install -- don't install all the way..
after you run the above function.. message box.. check the registry entry for feature included in this project.. you will see it there.. (I do).

--
When set the project for "No uninstall or Maitenance", it should not keep track of features in registry entries.
In this case if you use featuretransfterdata(), or FeatureMoveData() functions, it does create features registry entries.
0 Kudos