Old 28th February 2016, 21:38   #1
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
7z file outside the installer.

Hello everyone.

It's been a week i'm trying to build an installer. Everything is done except one thing. I can't find a way to build the installer with the 7z file outside. The folder which contains the subfolders and files is around 13.4 gb. With 7z on max compression it will go around 6 gb. So what i want to do is to build the installer with the data.7z next to it. During the installation the installer will extract the data in $INSTDIR.

Please don't recommand me CABSetup plug-in. I downloaded it, read the steps in the readme file and i couldn't understand a thing. Everything looked so difficult. I have also tried the following but it didn't work:
Nsis7z::ExtractWithDetails "$EXEPATH\data.7z" "Installing: %s..."

I wish you guys have a solution. You are my last hope...
MsNs7 is offline   Reply With Quote
Old 28th February 2016, 21:58   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Instead of using a .7z file, try my fork for big installers: https://sourceforge.net/projects/nsisbi/.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 28th February 2016, 22:35   #3
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Huge thanks for assisting me Jason.
As a first step i added this line in my script: SetExOutFile true
Then i compiled it with makensisw.exe from your fork. The installer got created successfully together with a nsisbin file. The problem is that when i run the installer i get this error:


What can be wrong? :s
MsNs7 is offline   Reply With Quote
Old 28th February 2016, 22:54   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,105
Quote:
Originally Posted by MsNs7 View Post
I have also tried the following but it didn't work:
Nsis7z::ExtractWithDetails "$EXEPATH\data.7z" "Installing: %s..."
And didn't work means what exactly? Compiler error? Error when running? No error at run-time and no files extracted?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 28th February 2016, 23:04   #5
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Quote:
Originally Posted by Anders View Post
And didn't work means what exactly? Compiler error? Error when running? No error at run-time and no files extracted?
No error, nothing extracted. The data.7z was next to the installer.
MsNs7 is offline   Reply With Quote
Old 29th February 2016, 03:31   #6
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Quote:
Originally Posted by MsNs7 View Post
Nsis7z::ExtractWithDetails "$EXEPATH\data.7z" "Installing: %s..."
I don't think $EXEPATH exists, try using $EXEDIR.

As for the nsis error from my fork, try creating your installer again but without all the data. If it still fails, then I can start looking into it.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 29th February 2016, 09:19   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,105
Quote:
Originally Posted by JasonFriday13 View Post
I don't think $EXEPATH exists, try using $EXEDIR.
It does but it is the full path including the filename. If it did not exist he would have gotten a compiler warning. I think you found the smoking gun...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th February 2016, 12:17   #8
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Quote:
Originally Posted by JasonFriday13 View Post
I don't think $EXEPATH exists, try using $EXEDIR.

As for the nsis error from my fork, try creating your installer again but without all the data. If it still fails, then I can start looking into it.
Jason, huge thanks once again. You saved me! $EXEDIR works perfectly.

I have one more question guys. Why nsis7z can't decompress lzma2 archives? Is it outdated?
MsNs7 is offline   Reply With Quote
Old 29th February 2016, 14:27   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The current version of nsis7z is based on a Beta version of 7-zip. 7-zip 15.14 is now stable but I have not yet updated the plug-in. You can try an older version of the plug-in.
Afrow UK is offline   Reply With Quote
Old 29th February 2016, 19:49   #10
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Well, i used lzma on max compression level. I'm fine with the result.
MsNs7 is offline   Reply With Quote
Old 3rd March 2016, 16:16   #11
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Alright. The installer is ready and it looks awesome thanks to you guys. I put everything in an ISO file. I also included an autorun.inf file. Everything is perfect. Now i'm moving on the creation of the installer for the update patches of my application. It will be using VPatch. The idea is like this. There are some files (more than 14) that are ~100 mb each one of them. I don't want to include these files in the installer. So is there any way the installer does the following process?

- Checks those files if they are up-to-date in the installation folder.
- Then (If they are not) the installer patches them.
- Or (if they are) the installer will do a DetailPrint "<file name> is up-to-date!"

I certainly have already taken a look at the example.nsi file of VPatch. It seems in both normal way and hard way the installer includes the updated file. But i don't want that. I want to keep the installer ~100-120 mb max. By the way i would like to use the hard way so the .pat files are extracted in the plug-ins folder. In this way customers will not see any temporary files in the installation folder.

Thanks in advance.
MsNs7 is offline   Reply With Quote
Old 3rd March 2016, 22:44   #12
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
VPatch stores the differences in the files, so when you create the patch, you give it the original file that was on the "install disk", and the new version of the file, and the resulting .pat file contains the difference between them. I think it also stores checksum data to check the original file to see if it can be patched? I don't remember, I've only read the documentation.

Generally the .pat file is included in the installer with 'File', and you extract this file to the $pluginsdir, and call vpatch from there.

Quote:
Section
InitPluginsDir

File /oname="$PLUGINSDIR\patch.pat" "patch.pat"

VPatch::function ; example only, use a proper function from VPatch

SectionEnd

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 7th March 2016, 00:08   #13
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Alright i will try it and i will give you feedback as soon as possible.
Oh! Since i want to patch multiple files during the installation what am i supposed to do? Something like this?

vpatch::vpatchfile "$PLUGINSDIR\patch.pat"
vpatch::vpatchfile "$PLUGINSDIR\patch.pat"
.
.
.
vpatch::vpatchfile "$PLUGINSDIR\patch.pat"

In a few words, am i supposed to call the above command as many times as the files i want to patch?
MsNs7 is offline   Reply With Quote
Old 7th March 2016, 00:38   #14
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,105
If you have more than one .pat file then you need to delete the old and extract the new file for each. Maybe you should just play around with the plugin a bit to get a feel for how it works...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th March 2016, 15:28   #15
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
No it's actually only one .pat file. I used the VPatchGUI.exe and there i selected all the files i want to patch. E.g.:

file A v1 > file A v2
file B v1 > file B v2
.
.
.

But how do i call VPatch for each file during installation? I checked all the readme and example files of the plugin but i didn't find anything useful. :/
MsNs7 is offline   Reply With Quote
Old 7th March 2016, 20:35   #16
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,105
I have not used VPatch in years so I don't remember the details. I suggest that you just create some text files and then create some patches and just try to get it working on the easy to debug text files...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th March 2016, 23:52   #17
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
From the VPatch docs:
Quote:
Update the file during installation

Use the VPatch plug-in to update a file using a patch file:

vpatch::vpatchfile "patch.pat" "oldfile.txt" "temporary_newfile.txt"
The result of the patch operating will be added to the stack and can be one of the following texts:

OK
OK, new version already installed
An error occurred while patching
Patch data is invalid or corrupt
No suitable patches were found
For reference: http://nsis.sourceforge.net/Docs/VPatch/Readme.html.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 14th March 2016, 23:48   #18
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Guys i want to thank all of you, especially you Jason for helping me.
The main installer and the installer for the update patches are ready. I also want to thank Afrow for updating his Nsis7z plugin. I accidentally noticed that a few minutes ago. I would like to report some things about the plugin though, since i downloaded the new version and used it.

- If i use the x86-unicode version, no errors, nothing is extracted.
- If i use the x64-unicode version, i get the following error during compiling:
Invalid command: Nsis7z::ExtractWithDetails

- The x86-ansi version seems to be working well though.

I'm waiting for your reply Afrow.
P.S. The data.7z file is made by 7-Zip 15.14 (64-bit).
MsNs7 is offline   Reply With Quote
Old 15th March 2016, 02:48   #19
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
NSIS 2.x is ansi 32bit only (x86-ansi).
NSIS 3.x is ansi and unicode 32bit only (x86-ansi, x86-unicode).

You can compile NSIS 3.x as a 64bit version, this uses the 'amd64-unicode' plugin.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 15th March 2016, 12:17   #20
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You don't need to use the 64-bit version of the plug-in just because you've used the 64-bit version of 7-Zip to create the archive!

Stu
Afrow UK is offline   Reply With Quote
Old 16th March 2016, 12:01   #21
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
@Jason
I installed NSIS v3.x and installed the plugin but during compiling my script i was getting error(s). I can't remember what error(s) i was getting though. I was too tired and sleepy to solve another mystery. So i switched back to NSIS v2.50 and i installed the ansi version of the plugin. Both of them do their job so no problem.

@Afrow
Yeah i know. The situation was that i didn't know which version (x64 unicode, x86 unicode, x86 ansi) to install so i started testing each one of them. And while i was testing them, i faced those issues i reported.

Guys now i will need your experience one more time, hopefully the last one. I am head admin of a forum. That forum provides a software. Another head admin of that forum was responsible for the update patches of the software. Unfortunately that head admin is no longer active and the last time i asked him, he told me that he lost the nsis scripts and the old versions of the files he was creating patches for. The last cumulative patch he made was v8.

So here is my question now. Is there anyway i continue making cumulative patches considering i can't have the old versions of the files? And what i want isn't i continue providing his cumulative patch v8 and my cumulative patch next to it. What i want is i continue his cumulative patch so there is only one patch available. I wish you have a solution for this guys, i really do. Because for me, it already seems very tricky. :/
MsNs7 is offline   Reply With Quote
Old 17th March 2016, 06:04   #22
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
This is tricky. One answer is time consuming, which involves checking and patching. How many versions of the patches are still available?

The basic idea is that you are recreating the patch tree yourself. Basically you take a fresh install, copy the relevant files that need to be updated (these are the 'originals'), apply the first version of the patch, copy the updated files (these are 'v1', so to speak), apply the second version of the patch, copy those files (these are 'v2'), and so on.

Writing the scripts is another story, I haven't used VPatch before so I have very little experience in writing scripts that use it. The idea is to write a 'generation' script for each version, a script that auto-searches the versions and adds patches that didn't exist before.

This is just one possible solution, there may be better or worse ones out there.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 17th March 2016, 20:58   #23
MsNs7
Junior Member
 
Join Date: Feb 2016
Posts: 11
Right now, there is only his cumulative patch v8 and my patch v11 which is not cumulative. I have an idea and i want you tell

me if it will work.

- I do a clean install of the application.
- Compare the files of the installed app with the files of the current latest version of the app. Then save the old files in a folder named "initial".
- Install his cumulative patch and compare the files again. Then save the old files in a folder named "latest installed".
- I remove my patch v11 from the forum.
- I make a new patch v11 which is cumulative this time which can update fresh setups of the app and setups that have his v8 patch installed.
- And every time there is a new update i will just compare the files, copy the old ones and paste them in the "latest installed" folder overwriting the previous ones.

In this way, every new cumulative patch i will release it will be able to update fresh setups and setups that have the previous cumulative patch installed. What do you think?
MsNs7 is offline   Reply With Quote
Old 20th March 2016, 01:14   #24
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I think you are one step ahead of me. I don't have enough experience in this area, so at this point you know more about it than I do.

The problem solver in me says to try a couple of tests/processes offline and find one that works well, then build the new patch and 'publish' it online.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
2 gb limit, 7zip, files out of installer, nsis

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump