shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

The maximum size of a file in a CAB file

Sun Oct 19, 2008 11:24 am

Hi,
I'm wondering what is the maximum size of a file I could put into my installation project? The installation would consist of a few CAB files. I want to compress several files and one of them has a size of 2 GB. When I tried to build my project I received the following error:
Exception - Reason: Exception - CAB Format limit reached. The CAB file size is limited to 2GB, you can`t have more than 64K files in a CAB and you can`t compress files that are larger than 2GB.
As far as I understand, files larger than 2 GB can't be put in the installation. Is there a solution for this problem?

Cristi
Posts: 34
Joined: Wed Oct 08, 2008 8:44 am
Contact:  Website

Re: The maximum size of a file in a CAB file

Mon Oct 20, 2008 9:38 am

Hi,

Please note that the size of a file which needs to be included in a CAB cannot exceed 2GB. However you can try one of these approaches:

1. you can create a separate feature for this big file and activate the "One CAB archive per feature" option available in Media page, or

2. you can use the LZMA compression available in Media page. Please note that this option in available only for Enterprise projects.

Best regards,
Cristi
______________________________
Cristi Costache
Advanced Installer Team
http://www.advancedinstaller.com/

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Sun Oct 26, 2008 5:51 pm

Hi Cristi,
Unfortunately creating a separate feature for the big file didn't work - the same error occurs. However I have found a solution and it is splitting the file using a specialized software. This software creates a batch file for joining the pieces of the split file. Now I need to execute a batch file during the installation.
I'm wondering if AI allows executing a file during the progress of the installation after installing a specific file? I would like to make the execution silently so the user couldn't see the joining process.
If this couldn't be done another solution would be executing this batch file after the installation have finished but before showing the ExitDialog. Again the process should run silently.

Cristi
Posts: 34
Joined: Wed Oct 08, 2008 8:44 am
Contact:  Website

Re: The maximum size of a file in a CAB file

Mon Oct 27, 2008 9:41 am

Hi,
I'm wondering if AI allows executing a file during the progress of the installation after installing a specific file? I would like to make the execution silently so the user couldn't see the joining process.
Yes, AI allows executing a file silently. Please note that this has already been discussed on this forum. I recommend reading the following post:

http://www.advancedinstaller.com/forums ... 956#p19956

for more details. Please note that the custom action you may use can be scheduled under "InstallExecuteSequence -> InstallFiles".
If you have questions about this please don't hesitate to ask.

Best regards,
Cristi
______________________________
Cristi Costache
Advanced Installer Team
http://www.advancedinstaller.com/

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Tue Oct 28, 2008 10:24 pm

Hi Cristi,
Thank you for your reply. I'll deal with the silent execution later. Now I'm trying to find out how to execute this custom action after a specific file had been coppied on the target machine. I put this custom action where you told me to - "InstallExecuteSequence -> InstallFiles", but I don't know how to schedule its execution during the installation after the desired file is installed.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: The maximum size of a file in a CAB file

Wed Oct 29, 2008 5:45 pm

Hi,

Please note that the custom action should be executed as "Deferred" in order to run during the actual install process. If the custom action runs as "Immediate" it will be executed before the files are installed.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Thu Oct 30, 2008 8:38 pm

Hi cosmin,
This worked perfectly for executing the file during the installation process. Now I would like to execute it silently.
I've seen your post about creating a VB script:
cosmin wrote:

Code: Select all

const WindowStyleStealth  = &H20000000
set WSO = createobject("WScript.Shell")
WSO.run "%comspec% /c MyApp.exe", WindowStyleStealth, false
where "MyApp.exe" is the main EXE of your program.
However I don't know how to execute this script. If I add it as a New Attached Custom Action, the script doesn't work at all. Is the "Function Name" field important and what should I type in there?
And another question. Let's say the .bat file, which is executed in the VB script is in a subfolder of the Application Folder, called "New Folder". What is the realtive path to the .bat file in this case?

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: The maximum size of a file in a CAB file

Fri Oct 31, 2008 10:56 am

Hi,
However I don't know how to execute this script.
The code which hides the application window can be pasted into a .VBS file which can be added as an Attached custom action.
Is the "Function Name" field important and what should I type in there?
Yes, this field is important and it should contain the function in the VBScript you want to call. If you don't use any functions in your VBScript (like your custom action), the "Function Name" field should be empty. This way, the custom action will try to run the entire VBScript.
Let's say the .bat file, which is executed in the VB script is in a subfolder of the Application Folder, called "New Folder". What is the realtive path to the .bat file in this case?
Please note that the sample code doesn't specify the path of the target file. For a real custom action, you should specify the exact path of the file. Also, since the custom action runs as Deferred, it will not have access to installer properties.

However, if you want to use a file in the installation folder, you can try this approach:
- modify the .VBS file to look like this:

Code: Select all

const WindowStyleStealth  = &H20000000
set WSO = createobject("WScript.Shell")
dim command
command = "%comspec% /c" & Session.Property("CustomActionData") & "New Folder\MyApp.exe"
WSO.run command, WindowStyleStealth, false
- add the .VBS file as an Attached custom action
- make sure it is set as "Deferred" and that the "Function Name" field is empty
- in the "Action Data" field add the [APPDIR] property

When the installation runs, the value of the APPDIR property will be transfered into the "CustomActionData" property. This way, the "command" variable in the script will use this path: [APPDIR]New Folder\MyApp.exe".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Sat Nov 01, 2008 12:13 pm

Hi cosmin,
Thank you for your help. Everything is working OK if there are no blank spaces in the path to the .bat file. But if I install it for example in "C:\Program Files", the .bat file can't be executed. There isn't an error dialog appearing, but the files don't merge.
I saw a solution for the blank spaced path problem and it was putting triple quotes (""") around it. But since I have to use the Session.Property("CustomActionData") function this doesn't work. So my question is: Does this function return a string and how could these quotes be added to it?

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: The maximum size of a file in a CAB file

Mon Nov 03, 2008 9:43 am

Hi,

The path of the file needs to be enclosed by quotes if it contains blank spaces. In your case, you can add the quote character before and after you specify the path of the file. For example, the "command" variable can be set to:

Code: Select all

command = "%comspec% /c" & Chr(34) & Session.Property("CustomActionData") & "New Folder\MyApp.exe" & Chr(34)
Chr(34) uses the ASCII code of the " character to output the actual character.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Tue Nov 11, 2008 12:37 pm

Hi cosmin,
The hidden command is working properly. But I'm still having problems with this installer - probably with the Media options. I was able to create my installer one time using the 4.7 GB volume sizes, but it couldn't fit to 2 DVDs. So I decided to make a custom size of the cab files - 6 files x 713 MB each. It was very strange that the same error occured:
Exception - Reason: Exception - CAB Format limit reached. The CAB file size is limited to 2GB, you can`t have more than 64K files in a CAB and you can`t compress files that are larger than 2GB.
This happened when one of the split files (sized 1 GB) had been compressing. I'm not sure what to do, because this problem doesn't exist anymore - all the files are smaller then 2 GB and the CAB files contain no more than 5 files. Also the CAB size I've chosen is 713 MB.

I've read a post (can't find it now) by your colleague gigi, that CAB files more than 800 000 000 bytes are inefficient and that's why AI doesn't allow creating bigger CAB files. And even if that is so, I don't exceed this limit.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: The maximum size of a file in a CAB file

Tue Nov 11, 2008 5:47 pm

Hi,

I'm not sure why you are encountering this behavior. Please try deleting the cache folder and the generated installation package in order to perform a clean rebuild. If the problem persists, please send us the AIP with the problem to support at advancedinstaller dot com so we can investigate it.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Re: The maximum size of a file in a CAB file

Wed Nov 19, 2008 12:17 am

Hi
I found out that the problem was in the splitted files. When I tried to build the installer witout these files it worked well. Here are the details about this files:
temp.001 - 1 GB
temp.002 - 1 GB
temp.003 - 18.9 MB
The files are made by a software for splitting large files.
I made a project including only these files and when the second file (temp.002) was being archived, the error occurred. Could the fact that the files temp.001 & temp.002 have an equal size be a problem?

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Re: The maximum size of a file in a CAB file

Wed Nov 19, 2008 9:15 am

Hi,

The equal size shouldn't be a problem. Perhaps the problem is caused by the CAB configuration you are using. Please try this:
- in the "Media" tab of the "Media" page select the "Multiple Volumes" option
- click on the "CABs..." button
- in the Edit CAB Settings dialog use the "Custom CAB size" option
- use a size smaller than 700 Mb

If the problem persists even when using this option, please send us the AIP (project) file you are using to support at advancedinstaller dot com so we can investigate it.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”