|
|
|
|
#1 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
WimImage Plugin: For installers bigger than 2GB
So I've spent the last 5 days or so working on this plugin. What it does is read a directory and creates an image of it inside a .wim file. What better time to write a plugin like this than the recent death of Windows XP?
I've added the basics: AddDir, AppendDir, and Extract. I'm considering adding support for split .wim files too. Thanks to the .wim API, this plugin is Unicode only, and requires Windows Vista and up. It also requires Administrator privileges to work correctly. To compile the source code it also requires VS2012. I haven't checked if VS2010 works, but VS2008 definitely does not work. I'm not releasing source code just yet, I'll see if any bugs pop up first. I've included a 32 bit version and a 64 bit version, don't worry about the size as these are debug .dll's. The release versions are 12KB for 32 bit and 13KB for 64 bit. I've also included a readme file and an example script (setup for 32 bit). Just extract the files and compile the example. Also, WimImage::Extract overwrites any files with matching filenames, and by the looks of the WIMApplyImage flags, it doesn't support "off", "try", "ifnewer", and "ifdiff". If you have any problems, bugs, or questions, just reply in this thread. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
This is a cool idea!
Note: Server 2003 (and WinXP 64?) are not dead yet. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Also, the text editor in VS2012 is like spell check on steroids! Type in #include ", and it pops up a list of the include-able files and folders, type a \ and the same happens
. It underlines all functions and statements that aren't defined, and when the cursor is on a statement, it highlights the other parts of the file where it's used. Also, the tooltips display the definitions of functions and statements, like TRUE gives "#define TRUE 1".That's how I managed to write and debug about 500 lines of code in just 5 days. The SpiderBanner plugin has about 800 lines, but that took several months to write and bugfix. Also, I wrote the code for the 32 bit version first, and apart from changing .libs, the 64 bit version compiled with no source code changes, and it worked first time with my .cvs 64 bit build of nsis too . I love VS2012 .
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
So I've now implemented splitting of .wim files, and I can verify them with 7-zip. The problem is the coding samples and API are very vague about implementing a way to extract the data from the split .swm files.
I can extract the first .swm using the api, but after a bit of experimenting, I might have to implement my own loop that manually asks for the next file if it doesn't exist in the current dir, and manually extract each one. I still have one or two things I can try as well. Or I just don't implement splitting in the first place. I've made a tweak to the UI code so that it's non-intrusive now (it doesn't go changing stuff on the installer window anymore), other than that the basic code is unchanged (I haven't found any more bugs yet). "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
So I've got extracting split images working OK, but only if they all exist at the same time in the same directory. So it looks like I will have to manually copy each file off the discs to a temporary directory (using WIMCopyFile or similar) and apply the .wim from said temporary directory.
Also, I'll look at implementing a cancel routine which involves enabling the cancel button and hooking it's call to the main window, since the wim API supports cancelling operations. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
So the next alpha version is here. I've added support for splitting .wim files, and for copying them from one place to another (best used for optical media).
I don't think I will add support for cancel routines, the only one that makes sense is the one used in copying .wim files (if the files can't be accessed then why bother continuing with the install?). Still no source code included yet, still looking for bugs to appear. As before, I've included a readme file, an example script, and both 32 and 64 bit debug .dll files. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile Last edited by Anders; 15th September 2014 at 14:52. Reason: Requested by user |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
You should make a wiki page and that will also give you control over the attachments...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#8 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
I will soon, I generally wait for my software to be pretty stable before posting it on the wiki.
Now it's time to do alot of testing, as I don't plan to add any more features. The next release will probably be stable enough to be put on the wiki anyway. As usual, if any bugs pop up just reply in this thread. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#9 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
So here it is, the first release version with source code. I got rid of VS2012 and modified the header so that the plugin will compile on VS2008, both 32bit and 64bit. I linked the trunk version (r6489) of the plugin api with this release.
I have only tested this plugin with 3.0b0, though it should work with 3.0a0 and up. I've also tested it with trunk version r6489 64 bit builds and I haven't seen any bugs yet. Now available on the wiki: http://nsis.sourceforge.net/WimImage_plug-in. [edit] W00T! 500 posts! "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#10 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Reread the documentation, and the wimgapi.dll file is only included in Windows 7 and later, so I uploaded a new version with the corrected readme file. I also corrected the wiki page.
For this reason, I'm moving away from using the windows provided API, and start using wimlib (http://wimlib.sf.net) to create .wim files. This also gives the opportunity to create a cross-platform tool for creating .wim files from the build script. Eventually the creation side will be removed from the plugin and made into a command-line tool which can be run with !system, !execute or !finalize, or a compiler plugin (if that ever happens ).[edit] Also, the debug attachment above can be removed now as a proper release has been made. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile Last edited by JasonFriday13; 18th June 2014 at 12:28. |
|
|
|
|
|
#11 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
I've made another update, details:
Removed msvcr*.dll dependency, strings are dynamically allocated now. Also added string length checks for folder and file paths. Also, I've added an extra error code, so if you use the error codes in your installer, you'll have to check them against the list in the readme. Also, I had to link the static crt runtime in order to get the 64 bit divide routine, no other functions in the crt are used. The plugin size didn't go up, so really it's a win-win. Available at: http://nsis.sourceforge.net/WimImage_plug-in. I will probably start working on using wimlib as the base of this plugin, and transition to a python/scons build chain. I'll probably split the creation and extraction parts up, and probably use a wrapper .exe around ImageX.exe to create the .wim files. They will be statically linked, so it would probably run on Windows XP without dramas. What a hill I have to climb! [edit] Also, I noticed that the attachment earlier in this thread still hasn't been removed, can a mod remove it please? "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Jul 2010
Posts: 14
|
This is really cool, good work!
|
|
|
|
|
|
#13 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Thanks for the feedback
.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 100
|
JasonFriday13 - cool man!. This Plugin is very useful for my Deploying Game.
|
|
|
|
|
|
#15 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#17 | |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Quote:
Stu |
|
|
|
|
|
|
#18 |
|
Junior Member
Join Date: Sep 2010
Posts: 21
|
Hi, Afrow UK
I am using WinXP, a this plug-in is designed for Win7 and above, judging from description. |
|
|
|
|
|
#19 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Quote:
The plugin would have to use http://sourceforge.net/projects/wimlib/ to support all versions of Windows... IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#20 | |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Quote:
I main reason I wrote this plugin is because XP was declared End of Life in March/April 2014 and it's not longer supported. Windows 7 is the most used OS, recently passing 50% of all OS usage in the world. Using wimlib has been on my todo list, but it's not a high priority, the reason is as stated above. I stopped using XP 64 bit just weeks after Win 7 was released. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|