[ui] log display improvement

* Shift main dialog left in case of overlap
* Fix loss of application focus when displaying the log
* Display Windows version in the log
* Also switch to LZMA for UPX compression
* Closes #148
This commit is contained in:
Pete Batard 2013-06-25 22:50:22 +01:00
parent 6be21bbdbc
commit bbab5a148d
7 changed files with 59 additions and 20 deletions

View File

@ -2,9 +2,10 @@ SUBDIRS = src
TARGET = rufus
# This step produces the UPX compressed and signed releases that are made available for public download
# NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/)
release: all
@mv src/$(TARGET)$(EXEEXT) .
@$(STRIP) $(TARGET)$(EXEEXT)
@upx $(TARGET)$(EXEEXT)
@upx --lzma $(TARGET)$(EXEEXT)
@mv $(TARGET)$(EXEEXT) $(TARGET)_v$(VERSION)$(EXEEXT)
@cmd.exe /k _sign.cmd $(TARGET)_v$(VERSION)$(EXEEXT)

View File

@ -443,10 +443,11 @@ uninstall-am:
# This step produces the UPX compressed and signed releases that are made available for public download
# NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/)
release: all
@mv src/$(TARGET)$(EXEEXT) .
@$(STRIP) $(TARGET)$(EXEEXT)
@upx $(TARGET)$(EXEEXT)
@upx --lzma $(TARGET)$(EXEEXT)
@mv $(TARGET)$(EXEEXT) $(TARGET)_v$(VERSION)$(EXEEXT)
@cmd.exe /k _sign.cmd $(TARGET)_v$(VERSION)$(EXEEXT)

View File

@ -19,7 +19,7 @@ TAGVER=`echo $VER`
# of a .amend file in the current directory will do
if [ -f ./.amend ]; then
TAGVER=`expr $TAGVER - 1`
git tag -d "#$TAGVER"
git tag -d "b$TAGVER"
rm ./.amend;
fi
echo "setting nano to $TAGVER"

View File

@ -1274,6 +1274,8 @@ void InitDialog(HWND hDlg)
HDC hDC;
int i, i16, s16;
char tmp[128], *token;
BOOL is_x64 = FALSE;
BOOL (__stdcall *pIsWow64Process)(HANDLE, PBOOL) = NULL;
#ifdef RUFUS_TEST
ShowWindow(GetDlgItem(hDlg, IDC_TEST), SW_SHOW);
@ -1319,6 +1321,18 @@ void InitDialog(HWND hDlg)
rufus_version[i] = (uint16_t)atoi(token);
uprintf(APPLICATION_NAME " version %d.%d.%d.%d\n", rufus_version[0], rufus_version[1], rufus_version[2], rufus_version[3]);
// Detect if we're running a 32 or 64 bit system
if (sizeof(uintptr_t) < 8) {
pIsWow64Process = (BOOL (__stdcall *)(HANDLE, PBOOL))
GetProcAddress(GetModuleHandleA("KERNEL32"), "IsWow64Process");
if (pIsWow64Process != NULL) {
(*pIsWow64Process)(GetCurrentProcess(), &is_x64);
}
} else {
is_x64 = TRUE;
}
uprintf("Windows version: %s %d-bit\n", PrintWindowsVersion(nWindowsVersion), is_x64?64:32);
// Prefer FreeDOS to MS-DOS
selection_default = DT_FREEDOS;
// Create the status line and initialize the taskbar icon for progress overlay
@ -1548,16 +1562,22 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
Point.x = min(DialogRect.right + GetSystemMetrics(SM_CXSIZEFRAME)+(int)(2.0f * fScale), DesktopRect.right - nWidth);
Point.y = max(DialogRect.top, DesktopRect.top - nHeight);
MoveWindow(hLogDlg, Point.x, Point.y, nWidth, nHeight, FALSE);
// The log may have been recentered to fit the screen, in which case, try to shift our main dialog left
nWidth = DialogRect.right - DialogRect.left;
nHeight = DialogRect.bottom - DialogRect.top;
MoveWindow(hDlg, max((DialogRect.left<0)?DialogRect.left:0,
Point.x - nWidth - GetSystemMetrics(SM_CXSIZEFRAME) - (int)(2.0f * fScale)), Point.y, nWidth, nHeight, TRUE);
first_log_display = FALSE;
}
// Display the log Window
log_displayed = !log_displayed;
ShowWindow(hLogDlg, log_displayed?SW_SHOW:SW_HIDE);
if (IsShown(hISOProgressDlg))
SetFocus(hISOProgressDlg);
// Set focus on the start button
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE);
// Must come last for the log window to get focus
ShowWindow(hLogDlg, log_displayed?SW_SHOW:SW_HIDE);
break;
#ifdef RUFUS_TEST
case IDC_TEST:

View File

@ -242,14 +242,14 @@ typedef enum TASKBAR_PROGRESS_FLAGS
/* Windows versions */
enum WindowsVersion {
WINDOWS_UNDEFINED,
WINDOWS_UNDEFINED = 0,
WINDOWS_UNSUPPORTED,
WINDOWS_XP,
WINDOWS_2003,
WINDOWS_2003, // Also XP x64
WINDOWS_VISTA,
WINDOWS_7,
WINDOWS_8,
WINDOWS_9
WINDOWS_8_OR_LATER,
WINDOWS_MAX
};
/*
@ -277,6 +277,7 @@ extern int dialog_showing;
* Shared prototypes
*/
extern enum WindowsVersion DetectWindowsVersion(void);
extern const char* PrintWindowsVersion(enum WindowsVersion version);
extern const char *WindowsErrorString(void);
extern void DumpBufferHex(void *buf, size_t size);
extern void PrintStatus(unsigned int duration, BOOL debug, const char *format, ...);

View File

@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.3.4.259"
CAPTION "Rufus v1.3.4.260"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -278,8 +278,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,4,259
PRODUCTVERSION 1,3,4,259
FILEVERSION 1,3,4,260
PRODUCTVERSION 1,3,4,260
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -296,13 +296,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.3.4.259"
VALUE "FileVersion", "1.3.4.260"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.3.4.259"
VALUE "ProductVersion", "1.3.4.260"
END
END
BLOCK "VarFileInfo"

View File

@ -27,6 +27,17 @@
#include "msapi_utf8.h"
#include "rufus.h"
// Must be in the same order as enum WindowsVersion
static const char* WindowsVersionName[WINDOWS_MAX] = {
"Undefined",
"Windows 2000 or earlier (unsupported)",
"Windows XP",
"Windows 2003 (or XP x64)",
"Windows Vista",
"Windows 7",
"Windows 8 or later",
};
enum WindowsVersion nWindowsVersion = WINDOWS_UNDEFINED;
/*
@ -48,18 +59,23 @@ enum WindowsVersion DetectWindowsVersion(void)
if ((OSVersion.dwMajorVersion == 5) && (OSVersion.dwMinorVersion == 1))
return WINDOWS_XP;
if ((OSVersion.dwMajorVersion == 5) && (OSVersion.dwMinorVersion == 2))
return WINDOWS_2003;
return WINDOWS_2003;
if ((OSVersion.dwMajorVersion == 6) && (OSVersion.dwMinorVersion == 0))
return WINDOWS_VISTA;
return WINDOWS_VISTA;
if ((OSVersion.dwMajorVersion == 6) && (OSVersion.dwMinorVersion == 1))
return WINDOWS_7;
if ((OSVersion.dwMajorVersion == 6) && (OSVersion.dwMinorVersion == 2))
return WINDOWS_8;
if ((OSVersion.dwMajorVersion > 6) || ((OSVersion.dwMajorVersion == 6) && (OSVersion.dwMinorVersion >= 3)))
return WINDOWS_9;
return WINDOWS_7;
if ((OSVersion.dwMajorVersion > 6) || ((OSVersion.dwMajorVersion == 6) && (OSVersion.dwMinorVersion >= 2)))
return WINDOWS_8_OR_LATER;
return WINDOWS_UNSUPPORTED;
}
const char* PrintWindowsVersion(enum WindowsVersion version)
{
if ((version < 0) || (version >= WINDOWS_MAX))
version = WINDOWS_UNDEFINED;
return WindowsVersionName[version];
}
/*
* String array manipulation
*/