diff --git a/out/heidisql.iss b/out/heidisql.iss
index 8ba5b681..f933642d 100644
--- a/out/heidisql.iss
+++ b/out/heidisql.iss
@@ -37,6 +37,7 @@ OutputDir={#OutDir}
OutputBaseFilename={#ProgName}_{#ProgShortVersion}_Setup
UninstallDisplayIcon={app}\{#ProgExeName}
SetupIconFile={#ResourceDir}mainicon.ico
+ArchitecturesInstallIn64BitMode=x64
UsePreviousAppDir=yes
DirExistsWarning=auto
PrivilegesRequired=none
@@ -60,12 +61,15 @@ Type: files; Name: "{app}\donate.url"
Type: files; Name: "{app}\function.txt"
[Files]
-Source: "{#ProgExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "{#ProgNameLower}64.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}"; Check: Is64BitInstallMode; Flags: ignoreversion
+Source: "{#ProgNameLower}32.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "readme.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "gpl.txt"; DestDir: "{app}"; Flags: ignoreversion
-Source: "libmysql.dll"; DestDir: "{app}"; Flags: ignoreversion
-Source: "plugins\*.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion
+Source: "libmysql64.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
+Source: "libmysql32.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
+Source: "plugins64\*.dll"; DestDir: "{app}\plugins"; Check: Is64BitInstallMode; Flags: ignoreversion
+Source: "plugins32\*.dll"; DestDir: "{app}\plugins"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "Snippets\*.sql"; DestDir: "{commonappdata}\{#ProgName}\Snippets";
[Icons]
diff --git a/out/libmysql.dll b/out/libmysql32.dll
similarity index 100%
rename from out/libmysql.dll
rename to out/libmysql32.dll
diff --git a/out/libmysql64.dll b/out/libmysql64.dll
new file mode 100644
index 00000000..c85f0367
Binary files /dev/null and b/out/libmysql64.dll differ
diff --git a/out/plugins/dialog.dll b/out/plugins32/dialog.dll
similarity index 100%
rename from out/plugins/dialog.dll
rename to out/plugins32/dialog.dll
diff --git a/out/plugins64/dialog.dll b/out/plugins64/dialog.dll
new file mode 100644
index 00000000..4c19d394
Binary files /dev/null and b/out/plugins64/dialog.dll differ
diff --git a/res/manifest.rc b/res/manifest.rc
deleted file mode 100644
index 895225fe..00000000
--- a/res/manifest.rc
+++ /dev/null
@@ -1 +0,0 @@
-1 24 "manifest.xml"
\ No newline at end of file
diff --git a/res/manifest32.rc b/res/manifest32.rc
new file mode 100644
index 00000000..24880a1f
--- /dev/null
+++ b/res/manifest32.rc
@@ -0,0 +1 @@
+1 24 "manifest32.xml"
\ No newline at end of file
diff --git a/res/manifest.xml b/res/manifest32.xml
similarity index 100%
rename from res/manifest.xml
rename to res/manifest32.xml
diff --git a/res/manifest64.rc b/res/manifest64.rc
new file mode 100644
index 00000000..00a9b6e6
--- /dev/null
+++ b/res/manifest64.rc
@@ -0,0 +1 @@
+1 24 "manifest64.xml"
\ No newline at end of file
diff --git a/res/manifest64.xml b/res/manifest64.xml
new file mode 100644
index 00000000..26f26675
--- /dev/null
+++ b/res/manifest64.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ A lightweight, fast and flexible interface to MySQL
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/updater/updater.dproj b/res/updater/updater.dproj
index f8037f60..f7a3b42e 100644
--- a/res/updater/updater.dproj
+++ b/res/updater/updater.dproj
@@ -1,110 +1,137 @@
-
-
- {24E2AAD6-CDE7-46EC-95BD-79028373B17A}
- 12.0
- updater.dpr
- Debug
- DCC32
-
-
- true
-
-
- true
- Base
- true
-
-
- true
- Base
- true
-
-
- ..\
- vcl;rtl;vclx;vclimg;vclactnband;dbrtl;vcldb;vcldbx;bdertl;vcltouch;xmlrtl;dsnap;dsnapcon;TeeUI;TeeDB;Tee;vclib;ibxpress;adortl;IndyCore;IndySystem;IndyProtocols;inet;intrawebdb_100_140;Intraweb_100_140;VclSmp;vclie;websnap;webdsnap;inetdb;inetdbbde;inetdbxpress;soaprtl;vclribbon;dbexpress;DbxCommonDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;DbxClientDriver;DataSnapServer;DBXInterBaseDriver;DBXMySQLDriver;dbxcds;DBXFirebirdDriver;DBXSybaseASEDriver;DBXSybaseASADriver;DBXOracleDriver;DBXMSSQLDriver;DBXInformixDriver;DBXDb2Driver;madBasic_;madDisAsm_;madExcept_;SynEditR;VirtualTreesR
- ..\updater.exe
- 00400000
- WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)
- x86
- false
- false
- false
- false
- false
-
-
- false
- RELEASE;$(DCC_Define)
- 0
- false
-
-
- DEBUG;$(DCC_Define)
-
-
-
- MainSource
-
-
- Base
-
-
- Cfg_2
- Base
-
-
- Cfg_1
- Base
-
-
-
-
- Delphi.Personality.12
-
-
-
-
- updater.dpr
-
-
- False
- True
- False
-
-
- False
- False
- 1
- 0
- 0
- 0
- False
- False
- False
- False
- False
- 1031
- 1252
-
-
-
-
- 1.0.0.0
-
-
-
-
-
- 1.0.0.0
-
-
-
- File D:\heidisql\trunk\components\pngcomponents\build\PngComponentsD.bpl not found
- Microsoft Office 2000 Sample Automation Server Wrapper Components
- Microsoft Office XP Sample Automation Server Wrapper Components
-
-
-
- 12
-
-
+
+
+ {24E2AAD6-CDE7-46EC-95BD-79028373B17A}
+ 15.1
+ updater.dpr
+ Debug
+ DCC32
+ True
+ Console
+ None
+ Win64
+ 3
+
+
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ 1031
+ CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
+ System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)
+ ..\
+ vcl;rtl;vclx;vclimg;vclactnband;dbrtl;vcldb;vcldbx;bdertl;vcltouch;xmlrtl;dsnap;dsnapcon;TeeUI;TeeDB;Tee;vclib;ibxpress;adortl;IndyCore;IndySystem;IndyProtocols;inet;intrawebdb_100_140;Intraweb_100_140;VclSmp;vclie;websnap;webdsnap;inetdb;inetdbbde;inetdbxpress;soaprtl;vclribbon;dbexpress;DbxCommonDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;DbxClientDriver;DataSnapServer;DBXInterBaseDriver;DBXMySQLDriver;dbxcds;DBXFirebirdDriver;DBXSybaseASEDriver;DBXSybaseASADriver;DBXOracleDriver;DBXMSSQLDriver;DBXInformixDriver;DBXDb2Driver;madBasic_;madDisAsm_;madExcept_;SynEditR;VirtualTreesR;$(DCC_UsePackage)
+ ..\updater.exe
+ 00400000
+ x86
+ false
+ false
+ false
+ false
+ false
+
+
+ Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
+ 1033
+
+
+ System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)
+ 1033
+
+
+ false
+ RELEASE;$(DCC_Define)
+ 0
+ 0
+
+
+ DEBUG;$(DCC_Define)
+
+
+
+ MainSource
+
+
+ Cfg_2
+ Base
+
+
+ Base
+
+
+ Cfg_1
+ Base
+
+
+
+
+ Delphi.Personality.12
+
+
+
+
+ updater.dpr
+
+
+
+ False
+ False
+ 1
+ 0
+ 0
+ 0
+ False
+ False
+ False
+ False
+ False
+ 1031
+ 1252
+
+
+
+
+ 1.0.0.0
+
+
+
+
+
+ 1.0.0.0
+
+
+
+ File D:\heidisql\trunk\components\pngcomponents\build\PngComponentsD.bpl not found
+ Microsoft Office 2000 Sample Automation Server Wrapper Components
+ Microsoft Office XP Sample Automation Server Wrapper Components
+
+
+
+ False
+ True
+ True
+
+
+ 12
+
+
+
diff --git a/res/updater.exe b/res/updater32.exe
similarity index 100%
rename from res/updater.exe
rename to res/updater32.exe
diff --git a/res/updater.rc b/res/updater32.rc
similarity index 100%
rename from res/updater.rc
rename to res/updater32.rc
diff --git a/res/updater64.exe b/res/updater64.exe
new file mode 100644
index 00000000..6da85ada
Binary files /dev/null and b/res/updater64.exe differ
diff --git a/res/updater64.rc b/res/updater64.rc
new file mode 100644
index 00000000..23299a52
--- /dev/null
+++ b/res/updater64.rc
@@ -0,0 +1 @@
+updater exe "updater.exe"
\ No newline at end of file
diff --git a/res/version.rc b/res/version.rc
index 87ad42d5..7b1a0fd8 100644
--- a/res/version.rc
+++ b/res/version.rc
@@ -7,7 +7,7 @@
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "FileDescription", "%APPNAME% %APPVER% 32 Bit\000"
+ VALUE "FileDescription", "%APPNAME% %APPVER%\000"
VALUE "ProductName", "%APPNAME%\000"
VALUE "LegalCopyright", "See GPL license\000"
END
diff --git a/source/helpers.pas b/source/helpers.pas
index b5c53892..b155a359 100644
--- a/source/helpers.pas
+++ b/source/helpers.pas
@@ -320,6 +320,7 @@ type
function GetOutputFilenamePlaceholders: TStringList;
function GetSystemImageList: TImageList;
function GetSystemImageIndex(Filename: String): Integer;
+ function GetExecutableBits: Byte;
var
@@ -2631,6 +2632,45 @@ begin
end;
+function GetExecutableBits: Byte;
+const
+ kb32 = 1024 * 32;
+var
+ ExeFilename: String;
+ Buffer: Array[0..kb32-1] of Byte; // warning: assuming both headers are in there!
+ hFile: DWord;
+ bRead: DWord;
+ bToRead: DWord;
+ pDos: PImageDosHeader;
+ pNt: PImageNtHeaders;
+begin
+ Result := 32;
+ ExeFilename := ParamStr(0);
+ hFile := CreateFile(pChar(ExeFilename), GENERIC_READ, FILE_SHARE_READ, NIL, OPEN_EXISTING, 0, 0);
+ if hFile <> INVALID_HANDLE_VALUE then try
+ bToRead := GetFileSize(hFile, NIL);
+ if bToRead > kb32 then
+ bToRead := kb32;
+ if not ReadFile(hFile, Buffer, bToRead, bRead, NIL) then
+ Exit;
+ if bRead = bToRead then begin
+ pDos := @Buffer[0];
+ if pDos.e_magic = IMAGE_DOS_SIGNATURE then begin
+ pNt := PImageNtHeaders(LongInt(pDos) + pDos._lfanew);
+ if pNt.Signature = IMAGE_NT_SIGNATURE then begin
+ if pNt.FileHeader.Machine and IMAGE_FILE_32BIT_MACHINE > 0 then
+ Result := 32
+ else
+ Result := 64
+ end;
+ end;
+ end;
+ finally
+ CloseHandle(hFile);
+ end;
+end;
+
+
diff --git a/source/updatecheck.pas b/source/updatecheck.pas
index 3c541112..ceebb73d 100644
--- a/source/updatecheck.pas
+++ b/source/updatecheck.pas
@@ -117,7 +117,7 @@ begin
// Prepare download
CheckfileDownload := THttpDownload.Create(Self);
CheckfileDownload.TimeOut := 5;
- CheckfileDownload.URL := APPDOMAIN+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&t='+DateTimeToStr(Now);
+ CheckfileDownload.URL := APPDOMAIN+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now);
CheckFilename := GetTempDir + APPNAME + '_updatecheck.ini';
// Download the check file