Professional Documents
Culture Documents
62
This program is an mpq archiver I started as an example of a program using the Mpq Control,
but it now uses SFmpq directly. It currently has many features and is one of the best mpq
archivers around.
General syntax:
Filenames containing spaces must be enclosed in quotation marks like this:
Parameters in <> are required, ones in [] are optional. MPQFile is the MoPaQ to add the
file(s) to. SourceFile is the file(s) to add to the MoPaQ. If there is only a single file being
added (no wildcards are used), DestinationFile is the name that the file will be stored as
in the MoPaQ. But, if there are multiple files to add (wildcards are used), DestinationFile
is the directory to put the files in. /c tells WinMPQ to compress the file(s). /wav tells
WinMPQ to add the file with WAV compression, which is recommended for .WAV files (if
both /c and /wav are used, /c will be ignored and /wav used). /auto tells WinMPQ to
automatically select the appropriate compression option for each file (if any other
compression options are used, they will override this). /r tells WinMPQ to recurse
through subdirectories when searching for files to add. If no DestinationFile is given, the
file will be added with the same name as SourceFile.
The parameters in <> are required, ones in [] are optional. SourceFile is the FULL name
of the file(s) to be extracted from the MoPaQ, and DestinationDirectory is the directory in
which to put the extracted file(s). If DestinationDirectory is absent, the file will be placed
in the current directory. Wildcards may be used in SourceFile. The /r parameter MPQ2K
uses currently isn't supported by WinMPQ. The /fp parameter specifies that WinMPQ
should extract the files with the full path.
All parameters are required. OldFileName is the full filename of the file to be renamed,
and NewFileName is the new name for the file. If wildcards are used with the rename
command, they must be used for both OldFileName and NewFileName.
All parameters are required. SourceFile is the file(s) to be moved (wildcards allowed),
DestinationDirectory is the virtual directory the file(s) to be moved will be placed in.
All parameters are required. FileToDelete is just that, the file(s) to delete. Wildcards may
be used in FileToDelete. /r can't be used with this command in WinMPQ.
The first time you use the delete command, you might be rather surprised to find that a
deleted file rarely takes up less space in a MoPaQ than a file that hasn't been deleted!
This is due to the fact that the delete command only marks a file as deleted; it doesn't
actually remove the file from the archive (to preempt the next question, no, you can't
undelete a deleted file). To actually remove the file from the MoPaQ, you must use the
flush command.
f[lush] <MPQFile>
The parameters in <> are required, ones in [] are optional. This will list all the files in the
MoPaQ to a text file. The [Filter] parameter is a wildcard filter that specifies what files to
list. The <Out_File> parameter tells WinMPQ the file to write the listing to.
Running Scripts - the Script Command
To run a script:
s[cript] <ScriptFile>
Writing Scripts
A script is basically a file that contains a lot of command lines for WinMPQ to process. This
allows you to compile one or more entire MoPaQs in a single process.
Parameters in <> are required, ones in [] are optional. MPQFile is the file to open.
FileLimit only takes affect when the archive is being created from scratch. It is the
maximum number of files that this archive can hold, and is 1024 by default. If the MoPaQ
already exists, FileLimit will have no effect, but no warning will be indicated. The FileLimit
parameter has a minimum value of 16, and a maximum value of 262144.
NOTE: Each file that a MoPaQ can hold (the FileLimit) takes up 16 bytes in the MoPaQ,
regardless of whether or not it is used. This can add up. For example, an empty MoPaQ
with a file limit of 262144 would be 4 MB large!
Parameters in <> are required, ones in [] are optional. MPQFile is the file to open. This
command will force WinMPQ to overwrite the archive and create a new one.
c[lose]
cd <NewDirectory>
Parameters in <> are required. NewDirectory is the directory the command will go to.
Use ".." to go to the parent directory.
<DriveLetter>:
Parameters in <> are required. DriveLetter is the letter of the drive you want to switch to.
x
or
exit
or
quit
Locale ID
The locale ID determines what language version of the software a file is intended for. Here is
a list of some of the ID numbers you can use for files.
0 Language Neutral/English
1031 (407 in hex) German
1033 (409 in hex) English (neutral is usually used instead of this)
1034 (40A in hex) Spanish
1036 (40C in hex) French
1040 (410 in hex) Italian
1046 (416 in hex) Portuguese
Version notes
The menu option for running Mo'PaQ 2000 scripts has support for almost everything. The /r
switch may only be used with Add, and the /lf and /p switches are not used with the List
command because WinMPQ does not display the list to the screen. Scripts can be run within
each other in WinMPQ. Use the /auto parameter with the Add command to use compression
auto-selection.
Version history
1.62__________
·3 Fixed a bug that prevented extracting empty files.
·4 Added an option that would allow one to have WinMPQ search a specified folder and all
of its subfolders for file lists with names similar to the open archive.
·5 When you add a file, you are prompted for what path to add to the beginning of the
filenames, and click cancel, WinMPQ no longer adds the files with no path added but
instead it cancels adding the files.
1.61__________
·6 WinMPQ was not closing the archive handle properly after adding files that have been
modified after being opened from WinMPQ. This was causing WinMPQ to be unable to
open the archive to add files, extract files, etc. This bug has been fixed in this version.
·7 Fixed a bug that caused WinMPQ to be unable to update a file in the archive that has
been modified.
·8 Mpq Embedder is now included with WinMPQ. Access it from the "Tools" menu.
·9 All options that were available by right-clicking a file are now also available from the
"Mpq" menu.
·10 The "Tools" menu is now also shown on the right-click context menu shown when right-
clicking on a file.
·11 The default compression type can be changed now, and the compression level for deflate
compression can set.
·12 Added a menu command to add a file to the listing if it is not listed and you know the
name of the file.
·13 Added a menu command to change the locale ID of an existing file.
1.60__________
·14 Switched to using SFmpq instead of Mpq Control.
·15 Added support for adding files with Warcraft III's new compression method.
·16 File encryption can now be enabled or disabled through the "Mpq" menu.
1.54__________
·17 Added an option to only use found file lists when using the option to automatically find file
lists.
·18 Implemented a workaround for the icon color limitation in Visual Basic 4 programs. Now
the icon shown when the program is running is 256 colors as it should be.
1.53__________
·19 No longer requires common dialog control.
1.52__________
·20 Fixed a bug that would sometimes prevent adding a file if only one was dragged to
WinMPQ or only one file was in the folder when using "Add Folder"
1.51__________
·21 Files are no longer added twice when dragging them to WinMPQ.
·22 Changed compact confirmation message.
1.50__________
·23 Fixed an error that would cause WinMPQ to crash if an archive was opened, a file was
opened from the archive, and the archive was deleted.
1.49__________
·24 Added an option to automatically use file lists with filenames similar to the open mpq
archive.
1.48__________
·25 Fixed a bug which caused WinMPQ to reload the archive when adding files.
·26 The mpq archive listing will now be reloaded if a script is run which modifies the currently
open archive.
·27 Added Warcraft III maps to open dialog filter.
1.47__________
·28 Adding a large number of files to an archive will no longer corrupt the file list in the
archive.
·29 Script output will now start displaying immediately, rather than after a few lines have
executed.
1.46__________
·30 Mpq archive loading progress is shown in the status bar now.
·31 Mpq archives load quicker.
1.45__________
·32 Combined all the options under the options menu into one dialog box with tabs.
·33 You may now load multiple file lists through the options menu.
·34 When dragging only one file from WinMPQ, the exact filename will always be given to the
program you drag the file to, instead of using wildcards.
·35 The filenames in the archive listing are now updated when using the rename or delete
commands through the mpq2k command box.
·36 Added extra names of existing commands.
·37 Almost has full support for Mpq2k scripts.
1.42__________
·38 Fixed a bug that caused WinMPQ to be unable to create or enumerate registry keys on
Windows NT4, 2000, or XP.
·39 Fixed some bugs with the popup menu that appears when right-clicking files.
·40 WinMPQ now notifies Windows when it associates itself with files, so Windows will
update the icon for MPQ archives.
·41 Added more checks for whether files exist. This was done to prevent crashes in some
instances.
1.40__________
·42 Fixed a division by zero error that would occur when displaying the compression ratio of
zero byte files.
1.39__________
·43 WinMPQ no longer does checks on open files while the options window is open.
Previously, this caused a message saying "This file is not an MPQ archive." to show
when the options window is opened after you've opened files in the MPQ archive.
1.38__________
·44 Fixed a bug that caused a "File not found" message when WinMPQ would check the day
and time a file was last modified. This caused WinMPQ to be unable to create new mpq
archives.
1.37__________
·45 Added a file filter box for making WinMPQ display files with a certain file extension
(separate filters with a semicolon ; for multiple filters).
·46 Added "Tools" menu for using the open mpq archive or the selected files in a program
other than what they are associated with (example: a hex editor).
·47 Made some improvements with the way files are handled when opening a file in an MPQ
archive or dragging files from an MPQ archive.
·48 Command prompt commands may be typed into the Mpq2k Command box at the bottom
of the window.
1.35__________
·49 Added a popup-menu that allows you to open a file with a program other than the default.
·50 WinMPQ can now be set to open a program other than the default when opening a file
from an MPQ archive.
·51 When you open a file from an MPQ archive and modify it, WinMPQ will display a prompt
asking if you want to add the modified file.
·52 Added option to disable loading extra file information. This can be used to make MPQ
archives load faster.
1.33__________
·53 Fixed a bug in the code that gets the names of files in a folder and its subfolders.
1.32__________
·54 MPQ2k commands can be typed in at a box at the bottom of the WinMPQ window.
·55 WinMPQ now uses the startup parameters MPQ2k uses.
·56 Added recent file list to file menu.
1.30__________
·57 Files can be dragged to WinMPQ to add files and from WinMPQ to extract files.
·58 Added compression auto-selection option.
·59 Added menu option that adds all the files in a folder and its subfolders.
·60 Added menu option to create a file list with the listed filenames in the MPQ archive.
·61 Added option to set the folder WinMPQ starts up at.
·62 Added option to associate MPQ archives with WinMPQ.
·63 The Delete menu option no longer asks if you want to delete a file when none is selected.
·64 The Extract menu option will now prompt you for the folder it will extract files to and will
also extract all the listed files when none are selected.
·65 Added option to suppress prompts.
·66 Filenames are shown on the title bar.
·67 Added a toolbar.
1.20__________
·68 Optional parameters in Mo'PaQ 2000 scripts are now optional as they should be.
·69 Wildcards and the /r switch work when using the A command in scripts.
·70 Scripts are now run in the folder they are located instead of the program's folder.
1.15__________
·71 Fixed a bug that prevented WinMPQ from recognizing that audio compression is
selected. Audio compression should work properly now.
·72 Added a way to assign a path to files you add without needing to rename them.
1.12__________
·73 Fixed a bug that caused embedded mpq archives to be improperly located, causing an
overflow when finding the total number of files.
1.11__________
·74 Fixed another renaming bug. It should work properly now.
1.10__________
·75 Fixed a bug that prevented the dialog box for adding files to show up on some systems.
1.01__________
·76 Fixed a file renaming bug.
·77 The method for finding embedded mpq archives is more reliable.
1.00__________
·78 Initial release.
Bug Reports
If you find a bug, please send me an e-mail with a description of the error and step-by-step
instuctions on how you made it happen.
-ShadowFlare
email: blakflare@hotmail.com
web page: http://shadowflare.ancillaediting.net/