Skip to content

Commit

Permalink
Setup and Registry Changes
Browse files Browse the repository at this point in the history
Took some time to overhaul the InnoSetup script. Added the Bouncy Castle
library and the PathTweaker console app, both of which were accidentally
omitted. I also removed all the Send To shortcut icons, since I found
out there's no way to address Issue #7 within the installer. (I'll
probably need to update the app to give the user the option to add those
shortcuts.) I'm removing the md5 and sha1 executables and replacing them
with batch files that call the hash console app behind the scenes, then
added additional batch files for the other hashes as well.

In the main app, I'm restructuring the registry settings a bit and
switching the hash and output type settings for an index value to a
string. This will future-proof the drop-downs a bit when we add future
hashes, as we'll no longer be dependent on the order the hashes are in
the drop-down. This means changes to the UpgradeSettings() method, the
MainForm constructor, and the MainForm_FormClosing() method; basically
anywhere the settings are written to or read from the registry.
  • Loading branch information
gpfjeff committed Jun 30, 2015
1 parent ee7928a commit 881526e
Show file tree
Hide file tree
Showing 18 changed files with 210 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ WinHasher/obj
WinHasherCore/bin
WinHasherCore/obj
WinHasher.v11.suo
InnoSetup/bin
Binary file added InnoSetup/PathTweaker.exe
Binary file not shown.
82 changes: 37 additions & 45 deletions InnoSetup/WinHasher.iss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AppName=WinHasher
AppVerName=WinHasher 1.7
LicenseFile=.\gpl.rtf
PrivilegesRequired=poweruser
MinVersion=4.1.1998,5.0.2195sp3
MinVersion=0,5.0.2195sp3
DefaultDirName={pf}\WinHasher
DefaultGroupName=WinHasher
AppID=GPFComicsWinHasher
Expand All @@ -26,45 +26,45 @@ AppUpdatesURL=https://github.com/gpfjeff/winhasher
AppVersion=WinHasher 1.7
UninstallDisplayName=WinHasher 1.7
SetupIconFile=..\WinHasher\Icon1.ico

[Files]
Source: ..\WinHasherCore\bin\Release\WinHasherCore.dll; DestDir: {app}; Components: Windows_application Console_applications
Source: ..\WinHasher\bin\Release\WinHasher.exe; DestDir: {app}; Components: Windows_application
Source: ..\hash\bin\Release\hash.exe; DestDir: {app}; Components: Console_applications
Source: ..\md5\bin\Release\md5.exe; DestDir: {app}; Components: Console_applications
Source: ..\sha1\bin\Release\sha1.exe; DestDir: {app}; Components: Console_applications
Source: ..\..\Mandelbrot_Madness\PathTweaker\bin\Release\PathTweaker.exe; DestDir: {app}; Components: Console_applications
Source: cmdhelp.html; DestDir: {app}; Flags: ignoreversion; Components: Console_applications and HTML_help_file
Source: guihelp.html; DestDir: {app}; Flags: ignoreversion; Components: Windows_application and HTML_help_file
Source: gpl.html; DestDir: {app}; Flags: ignoreversion; Components: HTML_help_file
Source: "..\WinHasherCore\bin\Release\WinHasherCore.dll"; DestDir: "{app}"; Components: Windows_application Console_applications
Source: "..\BouncyCastle.Crypto.dll"; DestDir: "{app}"; Components: Windows_application Console_applications
Source: "..\WinHasher\bin\Release\WinHasher.exe"; DestDir: "{app}"; Components: Windows_application
Source: "..\hash\bin\Release\hash.exe"; DestDir: "{app}"; Components: Console_applications
Source: "PathTweaker.exe"; DestDir: "{app}"; Components: Console_applications
Source: "cmdhelp.html"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications and HTML_help_file
Source: "guihelp.html"; DestDir: "{app}"; Flags: ignoreversion; Components: Windows_application and HTML_help_file
Source: "gpl.html"; DestDir: "{app}"; Flags: ignoreversion; Components: HTML_help_file
Source: "md5.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "sha1.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "sha224.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "sha256.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "sha384.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "sha512.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "ripemd128.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "ripemd160.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "ripemd256.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "ripemd320.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "whirlpool.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "tiger.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications
Source: "gost3411.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: Console_applications

[Components]
Name: Windows_application; Description: Check this box to install the Windows GUI version of WinHasher; Types: custom compact full
Name: Windows_application\Desktop_icon; Description: Place an icon for WinHasher on your desktop. If you are an administrator, this will make the icon available to all users.; Types: custom full
Name: Windows_application\QuickLaunch_icon; Description: Place an icon for WinHasher on your Quick Launch toolbar. Note that if you are an administrator, this will only install the icon for yourself.; Types: full
Name: Windows_application\MD5_SendTo; Description: Add an MD5 shortcut to the Send To menu; Types: custom full
Name: Windows_application\SHA1_SendTo; Description: Add an SHA-1 shortcut to the Send To menu; Types: custom full
Name: Windows_application\SHA256_SendTo; Description: Add an SHA-256 shortcut to the Send To menu; Types: full
Name: Windows_application\SHA384_SendTo; Description: Add an SHA-384 shortcut to the Send To menu; Types: full
Name: Windows_application\SHA512_SendTo; Description: Add an SHA-512 shortcut to the Send To menu; Types: full
Name: Windows_application\RIPEMD160_SendTo; Description: Add an RIPEMD-160 shortcut to the Send To menu; Types: full
Name: Windows_application\Whirlpool_SendTo; Description: Add a Whirlpool shortcut to the Send To menu; Types: full
Name: Windows_application\Tiger_SendTo; Description: Add a Tiger shortcut to the Send To menu; Types: full
Name: Console_applications; Description: Check this box to install the console (command-line) versions of WinHasher. This will also add the WinHasher program path to your PATH environment variable.; Types: custom full
Name: HTML_help_file; Description: Check this box to install the HTML help files, which will be accessible through the Start Menu.; Types: full compact custom
Name: "Windows_application"; Description: "Check this box to install the Windows GUI version of WinHasher"; Types: custom compact full
Name: "Windows_application\Desktop_icon"; Description: "Place an icon for WinHasher on your desktop. (If you are an administrator, this will make the icon available to all users.)"; Types: custom full
Name: "Windows_application\QuickLaunch_icon"; Description: "Place an icon for WinHasher on your Quick Launch toolbar. (This will only install the icon for yourself, not other users.)"; Types: full
Name: "Console_applications"; Description: "Check this box to install the console (command-line) versions of WinHasher. This will also add the WinHasher program path to your PATH environment variable."; Types: custom full
Name: "HTML_help_file"; Description: "Check this box to install the HTML help files, which will be accessible through the Start Menu."; Types: full compact custom

[Icons]
Name: {group}\WinHasher; Filename: {app}\WinHasher.exe; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application; Comment: WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files
Name: {group}\Command-line Help; Filename: {app}\cmdhelp.html; WorkingDir: {app}; Components: Console_applications and HTML_help_file; Comment: Display help information for the command-line version of WinHasher in your default Web browser
Name: {group}\Windows App Help; Filename: {app}\guihelp.html; WorkingDir: {app}; Components: Windows_application and HTML_help_file; Comment: Display help information for the Windows version of WinHasher in your default Web browser
Name: {group}\Uninstall WinHasher; Filename: {uninstallexe}; WorkingDir: {app}; Comment: Uninstall all WinHasher components
Name: {commondesktop}\WinHasher; Filename: {app}\WinHasher.exe; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\Desktop_icon; Comment: WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\WinHasher; Filename: {app}\WinHasher.exe; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\QuickLaunch_icon; Comment: WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files
Name: {sendto}\WinHasher\MD5; Filename: {app}\WinHasher.exe; Parameters: -md5; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\MD5_SendTo
Name: {sendto}\WinHasher\SHA-1; Filename: {app}\WinHasher.exe; Parameters: -sha1; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\SHA1_SendTo
Name: {sendto}\WinHasher\SHA-256; Filename: {app}\WinHasher.exe; Parameters: -sha256; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\SHA256_SendTo
Name: {sendto}\WinHasher\SHA-384; Filename: {app}\WinHasher.exe; Parameters: -sha384; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\SHA384_SendTo
Name: {sendto}\WinHasher\SHA-512; Filename: {app}\WinHasher.exe; Parameters: -sha512; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\SHA512_SendTo
Name: {sendto}\WinHasher\RIPEMD-160; Filename: {app}\WinHasher.exe; Parameters: -ripemd160; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\RIPEMD160_SendTo
Name: {sendto}\WinHasher\Whirlpool; Filename: {app}\WinHasher.exe; Parameters: -whirlpool; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\Whirlpool_SendTo
Name: {sendto}\WinHasher\Tiger; Filename: {app}\WinHasher.exe; Parameters: -tiger; WorkingDir: {userdocs}; IconFilename: {app}\WinHasher.exe; IconIndex: 0; Components: Windows_application\Tiger_SendTo
Name: "{group}\WinHasher"; Filename: "{app}\WinHasher.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\WinHasher.exe"; IconIndex: 0; Comment: "WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files"; Components: Windows_application
Name: "{group}\Command-line Help"; Filename: "{app}\cmdhelp.html"; WorkingDir: "{app}"; Comment: "Display help information for the command-line version of WinHasher in your default Web browser"; Components: Console_applications and HTML_help_file
Name: "{group}\Windows App Help"; Filename: "{app}\guihelp.html"; WorkingDir: "{app}"; Comment: "Display help information for the Windows version of WinHasher in your default Web browser"; Components: Windows_application and HTML_help_file
Name: "{group}\Uninstall WinHasher"; Filename: "{uninstallexe}"; WorkingDir: "{app}"; Comment: "Uninstall all WinHasher components"
Name: "{commondesktop}\WinHasher"; Filename: "{app}\WinHasher.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\WinHasher.exe"; IconIndex: 0; Comment: "WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files"; Components: Windows_application\Desktop_icon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\WinHasher"; Filename: "{app}\WinHasher.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\WinHasher.exe"; IconIndex: 0; Comment: "WinHasher allows you to computer cryptographic hashes of files, or compare the hashes of multiple files"; Components: Windows_application\QuickLaunch_icon

[Run]
Filename: {app}\PathTweaker.exe; Parameters: "-add ""{app}"""; WorkingDir: {app}; Flags: runminimized runhidden; Components: Console_applications; StatusMsg: "Adding ""{app}"" to the PATH..."
[UninstallRun]
Expand Down Expand Up @@ -138,11 +138,3 @@ begin
end;
end;
end;
// JTD: The following text has been added has been added to force TortoiseSVN's
// SubWCRev command to update the WinHasher.iss template with the appropriate
// revision number. Undoubtedly, this only works when the tempalte itself is
// modified, although we want it to occur when any code changes. So just before
// doing a release build, make sure to change the random string below to some-
// thing new to force SubWCRev to add the new info.
//
// Revision Tag: 302e35353536363430363235
8 changes: 8 additions & 0 deletions InnoSetup/gost3411.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running GOST3411 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -gost3411 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -gost3411 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/md5.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running MD5 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -md5 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -md5 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/ripemd128.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running RIPEMD-128 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -ripemd128 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -ripemd128 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/ripemd160.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running RIPEMD-160 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -ripemd160 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -ripemd160 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/ripemd256.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running RIPEMD-256 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -ripemd256 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -ripemd256 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/ripemd320.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running RIPEMD-320 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -ripemd320 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -ripemd320 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/sha1.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running SHA-1 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -sha1 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -sha1 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/sha224.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running SHA-224 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -sha224 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -sha224 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/sha256.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running SHA-256 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -sha256 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -sha256 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/sha384.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running SHA-384 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -sha384 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -sha384 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/sha512.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running SHA-512 Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -sha512 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -sha512 %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/tiger.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running Tiger Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -tiger %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -tiger %*
:endofbat
8 changes: 8 additions & 0 deletions InnoSetup/whirlpool.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@rem WinHasher Batch File for Running Whirlpool Hashes
@echo off
if "%OS%" == "Windows_NT" goto WinNT
hash -whirlpool %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofbat
:WinNT
hash -whirlpool %*
:endofbat
4 changes: 2 additions & 2 deletions WinHasher.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinHasherCore", "WinHasherCore\WinHasherCore.csproj", "{29D718A4-53DC-4AF5-AA4F-3F9ADBC87F20}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "md5", "md5\md5.csproj", "{EEE523FF-0B03-4A05-8368-8B48651D1251}"
Expand Down
Loading

0 comments on commit 881526e

Please sign in to comment.