From 2d8a674b885968ccc7f35c40d9a00e60dced9951 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 29 Nov 2011 22:53:00 +0000 Subject: [PATCH] [misc] handle all versioning in rufus.rc --- _pre-commit.sh | 6 +----- resource.h | 3 ++- rufus.c | 6 ++++-- rufus.h | 1 - rufus.rc | 22 +++++++++++++++++----- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/_pre-commit.sh b/_pre-commit.sh index ed4694d4..75674465 100644 --- a/_pre-commit.sh +++ b/_pre-commit.sh @@ -39,14 +39,10 @@ mv cmd.sed~ cmd.sed # Run sed to update the nano version # NB: we need to run git add else the modified files may be ignored sed -f cmd.sed ./rufus.rc > ./rufus.rc~ -# MinGW's sed has the bad habit of eating CRLFs +# MinGW's sed has the bad habit of eating CRLFs - make sure we keep 'em sed 's/$/\r/' ./rufus.rc~ > ./rufus.rc rm ./rufus.rc~ git add ./rufus.rc -sed -f cmd.sed ./rufus.h > ./rufus.h~ -sed 's/$/\r/' ./rufus.h~ > ./rufus.h -rm ./rufus.h~ -git add ./rufus.h #sed -f cmd.sed _bm.sh > _bm.sh~ #mv _bm.sh~ _bm.sh diff --git a/resource.h b/resource.h index 9dbea5de..a46c0d37 100644 --- a/resource.h +++ b/resource.h @@ -7,6 +7,7 @@ #define IDD_ABOUTBOX 103 #define IDD_NOTIFICATION 104 #define IDD_LICENSE 105 +#define IDS_VERSION 106 #define IDC_DEVICE 1001 #define IDC_FILESYSTEM 1002 #define IDC_START 1003 @@ -34,7 +35,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 106 +#define _APS_NEXT_RESOURCE_VALUE 107 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1043 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/rufus.c b/rufus.c index 1b393a4f..e9951cb9 100644 --- a/rufus.c +++ b/rufus.c @@ -954,6 +954,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA int nDeviceIndex; DWORD DeviceNum; char str[MAX_PATH], tmp[128]; + static char app_version[32]; static uintptr_t format_thid = -1L; static HWND hProgress; static LONG ProgressStyle = 0; @@ -983,7 +984,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA // Create the status line CreateStatusBar(); // Display the version in the right area of the status bar - SendMessageA(GetDlgItem(hDlg, IDC_STATUS), SB_SETTEXTA, SBT_OWNERDRAW | 1, (LPARAM)APP_VERSION); + LoadStringA(hMainInstance, IDS_VERSION, app_version, sizeof(app_version)); + SendMessageA(GetDlgItem(hDlg, IDC_STATUS), SB_SETTEXTA, SBT_OWNERDRAW | 1, (LPARAM)app_version); // We'll switch the progressbar to marquee and back => keep a copy of current style ProgressStyle = GetWindowLong(hProgress, GWL_STYLE); // Create the string array @@ -1002,7 +1004,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA SetTextColor(pDI->hDC, GetSysColor(COLOR_3DSHADOW)); pDI->rcItem.top += (int)(2.0f * fScale); pDI->rcItem.left += (int)(4.0f * fScale); - DrawTextExA(pDI->hDC, APP_VERSION, -1, &pDI->rcItem, DT_LEFT, NULL); + DrawTextExA(pDI->hDC, app_version, -1, &pDI->rcItem, DT_LEFT, NULL); return (INT_PTR)TRUE; } break; diff --git a/rufus.h b/rufus.h index 1efeaa57..2407fa46 100644 --- a/rufus.h +++ b/rufus.h @@ -22,7 +22,6 @@ #define RUFUS_DEBUG -#define APP_VERSION "Rufus v1.0.0.47" #define STR_NO_LABEL "NO_LABEL" #define RUFUS_CANCELBOX_TITLE "Rufus - Cancellation" #define DRIVE_INDEX_MIN 0x80 diff --git a/rufus.rc b/rufus.rc index 38c472e7..7fd9c268 100644 --- a/rufus.rc +++ b/rufus.rc @@ -63,7 +63,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "https://github.com/pbatard/rufus",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.0.0 (Build 47)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.0.0 (Build 48)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -162,8 +162,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,47 - PRODUCTVERSION 1,0,0,47 + FILEVERSION 1,0,0,48 + PRODUCTVERSION 1,0,0,48 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -180,13 +180,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.0.0.47" + VALUE "FileVersion", "1.0.0.48" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.0.0.47" + VALUE "ProductVersion", "1.0.0.48" END END BLOCK "VarFileInfo" @@ -204,6 +204,17 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON ICON "rufus.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_VERSION "Rufus v1.0.0.48" +END + #endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -223,3 +234,4 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "common_controls_and_elevation.ma ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED +