[gimp/gimp-2-8] Installer: display a warning when color depth < 32BPP
- From: Jernej SimonÄiÄ <jernejs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Installer: display a warning when color depth < 32BPP
- Date: Wed, 20 Jun 2012 22:14:03 +0000 (UTC)
commit 8f2246578d8f5f9b23dcd85131bbdde934b1f080
Author: Jernej SimonÄiÄ <jernej+s-gnome eternallybored org>
Date: Thu Jun 21 00:12:43 2012 +0200
Installer: display a warning when color depth < 32BPP
build/windows/installer/en.setup.isl | 5 +++
build/windows/installer/gimp3264.iss | 53 +++++++++++++++++++++++++++------
build/windows/installer/sl.setup.isl | 5 +++
3 files changed, 53 insertions(+), 10 deletions(-)
---
diff --git a/build/windows/installer/en.setup.isl b/build/windows/installer/en.setup.isl
index 2e8cfb0..f056bd5 100644
--- a/build/windows/installer/en.setup.isl
+++ b/build/windows/installer/en.setup.isl
@@ -15,6 +15,11 @@ DevelopmentButtonExit=Exit
;XPSP3Recommended=Warning: you are running an unsupported version of Windows. Please update to at least Windows XP with Service Pack 3 before reporting any problems.
SSERequired=This version of GIMP requires a processor that supports SSE instructions.
+Require32BPPTitle=Display settings problem
+Require32BPP=Setup has detected that your Windows is not running in 32 bits-per-pixel display mode. This has been known to cause stability problems with GIMP, so it's recommended to change the display colour depth to 32BPP before continuing.
+Require32BPPContinue=&Continue
+Require32BPPExit=E&xit
+
InstallOrCustomize=GIMP is now ready to be installed. Click the Install now button to install using the default settings, or click the Customize button if you'd like to have more control over what gets installed.
Install=&Install
Customize=&Customize
diff --git a/build/windows/installer/gimp3264.iss b/build/windows/installer/gimp3264.iss
index b1b7c7f..e8b9892 100644
--- a/build/windows/installer/gimp3264.iss
+++ b/build/windows/installer/gimp3264.iss
@@ -1,4 +1,4 @@
-ï;.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,
+;.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,
; ;
;Copyright (c) 2002-2010 Jernej SimonÄiÄ ;
; ;
@@ -213,7 +213,7 @@ Source: "{#GIMP_DIR32}\etc\*"; DestDir: "{app}\etc"; Components: gimp32 or gimp6
Source: "{#GIMP_DIR32}\lib\gimp\2.0\environ\*"; DestDir: "{app}\lib\gimp\2.0\environ"; Components: gimp32 or gimp64; Flags: recursesubdirs restartreplace
Source: "{#GIMP_DIR32}\lib\gimp\2.0\interpreters\*"; DestDir: "{app}\lib\gimp\2.0\interpreters"; Components: gimp32 or gimp64; Flags: recursesubdirs restartreplace
Source: "{#GIMP_DIR32}\share\gimp\*"; DestDir: "{app}\share\gimp"; Components: gimp32 or gimp64; Flags: recursesubdirs restartreplace
-;Source: "{#DEPS_DIR32}\share\enchant\*"; DestDir: "{app}\share\enchant"; Components: deps32 or deps64; Flags: recursesubdirs restartreplace
+Source: "{#DEPS_DIR32}\share\enchant\*"; DestDir: "{app}\share\enchant"; Components: deps32 or deps64; Flags: recursesubdirs restartreplace
Source: "{#DEPS_DIR32}\share\libwmf\*"; DestDir: "{app}\share\libwmf"; Components: deps32 or deps64; Flags: recursesubdirs restartreplace
Source: "{#DEPS_DIR32}\share\themes\*"; DestDir: "{app}\share\themes"; Components: deps32 or deps64; Flags: recursesubdirs restartreplace
Source: "{#DEPS_DIR32}\share\xml\*"; DestDir: "{app}\share\xml"; Components: deps32 or deps64; Flags: recursesubdirs restartreplace
@@ -289,8 +289,6 @@ Type: filesandordirs; Name: "{app}\Python\*"
[Code]
-function SHAutoComplete(hWnd: Integer; dwFlags: DWORD): Integer; external 'SHAutoComplete shlwapi dll stdcall delayload';
-
function WideCharToMultiByte(CodePage: Cardinal; dwFlags: DWORD; lpWideCharStr: String; cchWideCharStr: Integer;
lpMultiByteStr: PAnsiChar; cbMultiByte: Integer; lpDefaultChar: Integer;
lpUsedDefaultChar: Integer): Integer; external 'WideCharToMultiByte Kernel32 stdcall';
@@ -305,6 +303,12 @@ function GetSysColor(nIndex: Integer): DWORD; external 'GetSysColor user32 dll s
function IsProcessorFeaturePresent(ProcessorFeature: DWORD): LongBool; external 'IsProcessorFeaturePresent kernel32 stdcall';
+//functions needed to get BPP
+function GetDC(hWnd: Integer): Integer; external 'GetDC User32 stdcall';
+function ReleaseDC(hWnd, hDC: Integer): Integer; external 'ReleaseDC User32 stdcall';
+function GetDeviceCaps(hDC, nIndex: Integer): Integer; external 'GetDeviceCaps GDI32 stdcall';
+
+
procedure ComponentsListOnClick(pSender: TObject); forward;
procedure SaveToUninstInf(const pText: AnsiString); forward;
procedure CreateRunOnceEntry; forward;
@@ -314,14 +318,13 @@ const
CP_ACP = 0;
CP_UTF8 = 65001;
- SHACF_FILESYSTEM = $1;
- SHACF_FILESYS_ONLY = $10;
- SHACF_FILESYS_DIRS = $20;
-
COLOR_HOTLIGHT = 26;
PF_XMMI_INSTRUCTIONS_AVAILABLE = 6;
+ BITSPIXEL = 12;
+ PLANES = 14;
+
GIMP_URL = 'http://www.gimp.org/';
RTFHeader = '{\rtf1\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\fnil\fcharset2 Symbol;}}\viewkind4\uc1\fs16';
@@ -1392,8 +1395,6 @@ begin
UpdateWizardImages();
InitCustomPages();
- r := SHAutoComplete(WizardForm.DirEdit.Handle,SHACF_FILESYSTEM);
-
{if InstallMode = imRebootContinue then //ReadyMemo form isn't skipped if the wizard isn't shown
begin
DebugMsg('InitializeWizard','Continuing after reboot - showing wizard form');
@@ -1402,6 +1403,35 @@ begin
end;
+function BPPTooLowWarning(): Boolean;
+var hDC, bpp, pl: Integer;
+ Message,Buttons: TArrayOfString;
+begin
+ hDC := GetDC(0);
+ pl := GetDeviceCaps(hDC, PLANES);
+ bpp := GetDeviceCaps(hDC, BITSPIXEL);
+ ReleaseDC(0,hDC);
+
+ bpp := pl * bpp;
+
+ if bpp < 32 then
+ begin
+ SetArrayLength(Message,1);
+ SetArrayLength(Buttons,2);
+ Message[0] := CustomMessage('Require32BPP');
+ Buttons[0] := CustomMessage('Require32BPPContinue');
+ Buttons[1] := CustomMessage('Require32BPPExit');
+ if (not WizardSilent) and
+ (MessageWithURL(Message, CustomMessage('Require32BPPTitle'), Buttons, mbError, 2, 2) = 2) then
+ Result := False
+ else
+ Result := True;
+ end
+ else
+ Result := True;
+end;
+
+
function InitializeSetup(): Boolean;
#if (Defined(DEVEL) && DEVEL != "") || Defined(DEVEL_WARNING)
var Message,Buttons: TArrayOfString;
@@ -1418,6 +1448,9 @@ begin
Result := RestartSetupAfterReboot(); //resume install after reboot - skip all setting pages, and install directly
+ if Result then
+ Result := BPPTooLowWarning();
+
if not Result then //no need to do anything else
exit;
diff --git a/build/windows/installer/sl.setup.isl b/build/windows/installer/sl.setup.isl
index 499c339..7d61b65 100644
--- a/build/windows/installer/sl.setup.isl
+++ b/build/windows/installer/sl.setup.isl
@@ -13,6 +13,11 @@ DevelopmentButtonExit=Prekini
;XPSP3Recommended=Opozorilo: uporabljate nepodprto razlièo sistema Windows. Prosimo, namestite servisni paket 3 za Windows XP ali novejo razlièo sistema Windows preden nas obveèe o kakrnih koli teavah.
SSERequired=Ta razliica programa GIMP potrebuje procesor, ki ima podporo za SSE ukaze.
+Require32BPPTitle=Teava z zaslonskimi nastavitvami
+Require32BPP=Namestitveni program je zaznal, da Windows ne deluje v 32-bitnem barvnem naèu. Takne nastavitve lahko povzroèo nestabilnost programa GIMP, zato je priporoèivo da pred nadaljevanjem spremenite barvno globino zaslona na 32 bitov.
+Require32BPPContinue=&Nadaljuj
+Require32BPPExit=I&zhod
+
InstallOrCustomize=GIMP je pripravljen na namestitev. Kliknite gumb Namesti za namestitev s privzetimi nastavitvami, ali pa kliknite gumb Po meri, èbi radi imeli veèadzora nad monostmi namestitve.
Install=Namest&i
Customize=&Po meri
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]