Example: Bulk Rename Utility.
STEP 1: Files to be added to the SFX.
I downloaded the zipped version of BRU because I like customization :-)
I take out these files from the downloaded archive:
1- Bulk Rename Utility.exe
2- BRU_XP.dll
3- pcre.dll
4- Bulk Rename Utility.chm
5- Changelog.rtf
6- Readme.rtf
7- Tips.txt
I put the extracted files in C:\BRU.
STEP 2: Reg file for tweaks, if necessary.
I create BRUtweak.reg to configure BRU prior to the first use.
This is the content of BRUtweak.reg:
REGEDIT4 [HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Main Window] "AlwaysOnTop"=dword:00000000 "WindowPlacement"="1,37,800,536,3,2" "Col Name"=dword:000000a0 "Col NewName"=dword:000000a0 "Col SubDir"=dword:00000028 "Col Type"=dword:00000032 "Col Size"=dword:00000028 "Col Created"=dword:00000032 "Col Modified"=dword:00000032 "Col New Length"=dword:00000032 "Col Time Taken"=dword:00000032 "Col Attributes"=dword:00000032 [HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Preferences] "Favourite Path"="" "Auto Save Favourite On Exit"=dword:00000000 "Store Favourite Pathnames"=dword:00000000 "Display Icons"=dword:00000001 "Highlight Active Criteria"=dword:00000001 "Display Warning Message"=dword:00000001 "Display Confirmation Message"=dword:00000001 "Display Gridlines"=dword:00000001 "Full Row Select"=dword:00000000 "Overwrite Target Files"=dword:00000000 "New Location Copy Not Move"=dword:00000000 "Auto Select Entries"=dword:00000000 "Ignore Folder Extensions"=dword:00000001 "Change Attributes H"=dword:00000000 "Change Attributes A"=dword:00000001 "Change Attributes R"=dword:00000001 "Colour New Name OK"=dword:00008004 "Colour New Name Invalid"=dword:000000ff "Colour Active Criteria Back"=dword:00000080 "XP Sorting"=dword:00000001 "Sort Column"=dword:00000000 "Sort Dir"=dword:00000001 [HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Tip] "FilePos"=dword:0000020c "StartUp"=dword:00000000
As you can see, there are three main keys in BRUtweak.reg! They are:
[HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Main Window]
[HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Preferences]
[HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Tip]
Actually, and after using the program itself,
an additional key is written to the Registry. It is:
[HKEY_CURRENT_USER\Software\Jim Willsher\BULK RENAME UTILITY\Settings]
Well, that's actually no problem because deleting the key "Jim Willsher" will
delete the subkeys, too. This task is assigned to BRUunins.cmd as you'll see below.
STEP 3: Batch file for perfecting installation and uninstallation.
I create BRUtweak.cmd to:
1- run BRUtweak.reg then delete it.
2- Write uninstall strings to the Registry.
3- create BRUunins.cmd!
BRUunins.cmd will uninstall BRU when you press "Remove" in "Control Panel-->Add or Remove Programs".
Both BRUtweak.cmd and BRUunins.cmd are self-deleted.
This is the content of BRUtweak.cmd: (you just copy/paste)
BRUtweak.cmd said:
CD >NUL
:: Applying BRUtweak.reg ------------------------------------------- (1)
REGEDIT /S BRUtweak.reg
del BRUtweak.reg
:: Writing Uninstall strings to the Registry ----------------------- (2)
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BRU
REG ADD %KEY% /v DisplayName /d "Bulk Rename Utility 2.2.5.0"
REG ADD %KEY% /v DisplayIcon /d "%SystemDrive%\Program Files\Bulk Rename Utility\Bulk Rename Utility.exe"
REG ADD %KEY% /v UninstallString /d BRUunins.cmd
REG ADD %KEY% /v DisplayVersion /d 2.2.5.0
REG ADD %KEY% /v Publisher /d "Jim Willsher"
REG ADD %KEY% /v URLInfoAbout /d http://www.BulkRenameUtility.co.uk
REG ADD %KEY% /v HelpLink /d http://www.BulkRenameUtility.co.uk
REG ADD %KEY% /v URLUpdateInfo /d http://www.BulkRenameUtility.co.uk
REG ADD %KEY% /v NoModify /t REG_DWORD /d 1
REG ADD %KEY% /v NoRepair /t REG_DWORD /d 1
:: Creating BRUunins.cmd ------------------------------------------- (3)
echo @echo off>%SystemRoot%\BRUunins.cmd
echo CD>>%SystemRoot%\BRUunins.cmd
echo :: Deleting BRU directory from Program Files>>%SystemRoot%\BRUunins.cmd
echo RD /S /Q "%%SystemDrive%%\Program Files\Bulk Rename Utility">>%SystemRoot%\BRUunins.cmd
echo :: Deleting BRU shortcut folder from Start Menu>>%SystemRoot%\BRUunins.cmd
echo RD /S /Q "%%UserProfile%%\Start Menu\Programs\Bulk Rename Utility">>%SystemRoot%\BRUunins.cmd
echo :: Deleting BRU reg tweaks from the Registry>>%SystemRoot%\BRUunins.cmd
echo REG DELETE "HKCU\Software\Jim Willsher" /f>>%SystemRoot%\BRUunins.cmd
echo :: Deleting BRU uninstall strings from the Registry>>%SystemRoot%\BRUunins.cmd
echo REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BRU /f>>%SystemRoot%\BRUunins.cmd
echo :: Deleting BRUunins.cmd (oh! that's me! OOPS!)>>%SystemRoot%\BRUunins.cmd
echo del %%0>>%SystemRoot%\BRUunins.cmd
:: Deleting BRUtweak.cmd (oh! that's me! OOPS!) -------------------- (4)
del %0
STEP 4: Creating the SFX.
Well! So far, we've got 9 files. They are:
1- Bulk Rename Utility.exe
2- BRU_XP.dll
3- pcre.dll
4- Bulk Rename Utility.chm
5- Changelog.rtf
6- Readme.rtf
7- Tips.txt
8- BRUtweak.reg
9- BRUtweak.cmd
Assuming the 9 files are in C:\BRU, we do the following to create our SFX:
01- Open WinRAR. Browse to C:\BRU where you keep the 9 files.
02- Use your expertise with the keyboard and mouse to highlight (select) the 9 files.
03- Go to "Commands" menu. Select "Add files to archive". The "Archive name and parameters" dialog
box should appear with the "General" tab activated.
04- Tick "Create SFX archive" and "Create solid archive".
05- In the "Archive name" field, change the suggested name given by WinRAR to BRU.exe then
choose "Best" from the "compression method" combo box.
06- Go to "Advanced" tab. Press "SFX options". The "Advanced SFX options" dialog box appears
with the "General" tab activated.
07- In the "Path to extract" field, type "Bulk Rename Utility" without quotes.
-- This means that the package (SFX) will be extract, during installation, to:
%ProgramFiles%\Bulk Rename Utility.
-- Make sure the "Create in "Program Files"" radio button is selected.
-- Make sure the "Save and restore paths" check box is not checked.
08- In the "Run after extraction" field, type "BRUtweak.cmd" without quotes.
-- As shown in STEP 3, BRUtweak.cmd is necessary to be run after extraction to perform some tasks.
09- Still in the "Advanced SFX options" dialog box, press the "Advanced" tab.
-- Press the "Add shortcut..." button. The "Add shortcut" dialog box appears.
-- Select "Start Menu/Programs". In the "Source file name" field, type "Bulk Rename Utility.exe"
without quotes. This is the name of the file you create a shortcut to.
-- In the "Destination folder" field, type "Bulk Rename Utility" without quotes.
This is the name of the shortcut folder that will be created under:
%UserProfile%\Start Menu\Programs.
-- In the "Shortcut description" field, type
"Bulk Rename Utility - Renames multiple files on the fly!" without quotes.
-- In the "Shortcut name" field, type "Bulk Rename Utility" without quotes.
This is the link that will appear as:
%UserProfile%\Start Menu\Programs\Bulk Rename Utility\Bulk Rename Utility.lnk
-- Now, press "Ok" to return back to the "Advanced" tab.
++ Repeat the same steps again to create two more shortcuts; one for "Bulk Rename Utility.chm"
and one for "Readme.rtf".
10- Still in the "Advanced SFX options" dialog box, press the "Modes" tab.
-- Under "Silent mode", select "Hide all". This tells the SFX not to show setup screens.
-- Under "Overwrite mode", select "Overwrite all files". This tells the SFX to overwrite any files
pre-existing in the destination folder %ProgramFiles%\Bulk Rename Utility, if there's any.
11- Press "Ok" on the "Advanced SFX options" dialog box to close.
-- Press "Ok" on the "Archive name and parameters" dialog box and wait for the compression
process to finish. BRU.exe is now created in C:\BRU.
12- Move BRU.exe to a safe place on your harddisk as you'll use it to install BRU afterwards.
-- Delete the folder C:\BRU as it's no longer needed.
STEP 5: Installing BRU from your UAXPCD.
Since you configured the SFX (BRU.exe) to install silently (Hide all) you don't need to add switches
on the command line when installing BRU. Simply, you install it this way:
start /wait %SystemDrive%\Install\BRU.exe
This assumes that BRU.exe is put in %SystemDrive%\Install at the time of installation.
Otherwise, change the path to your own.
Note: Save time when creating a SFX.
Steps from 07 through 10 are summarized here:
Comment said:
Setup=BRUtweak.cmd
Silent=1
Overwrite=1
Shortcut=P, "Bulk Rename Utility.exe", "Bulk Rename Utility", "Bulk Rename Utility - Renames multiple files on the fly!", "Bulk Rename Utility"
Shortcut=P, "Bulk Rename Utility.chm", "Bulk Rename Utility", "Bulk Rename Utility Help", "Help"
Shortcut=P, "Readme.rtf", "Bulk Rename Utility", "Info about BRU", "Read Me"
This summary is called "Comment".
Actually, if you have this comment in hand, you can ignore Steps from 07 through 10.
In Step 06, go to the "Comment" tab directly instead of going to the "Advanced" tab.
In the "Enter a comment manually" field, just paste the above Comment, then press "Ok".
You're done!
Attached File(s)
-
BRU.JPG (26.6K)
Number of downloads: 244
This post has been edited by mazin: 21 September 2006 - 07:39 PM



Help
Back to top










