19-10-2012, 11:10 AM
السلام عليكم
النسخة المحمولة لـ Firebird متوفرة ومعروفة لدى الجميع Embedded...
في هذا الموضوع محاولة لأحدهم (من delphipraxis المكنى neo4a) لإنشاء نسخة محمولة من Firebird Server في ملف تطبيقي واحد
والنتيجة ملف وحيد يشغل خادم Firebird يكتشف ملفات قواعد البيانات التي من حوله ويضعها عرضة للاتصال من خلال IP ومنفذ، من خصائصها:
- تشغيل/اتصال متعدد
- لا حاجة لصلاحيات نظام
- رصد تلقائي لملفات قواعد البيانات
...
بغض النظر عن المنتج، دعونا نلقي نظرة على المحاكاة الافتراضية وكيف تمت:
أخذ صديقنا مجلد Firebird بحجمه (9 Mb تقريبا) ضغطه في ملف Resouces مستخدما SDK BoxedApp
فك الملف كما يلي:
الناتج ما يقارب 12Mb، أضاف إليه بعض البهارات ثم ضغطه بـ PECompact ليحصل على تطبيق 3Mb
الناتج:
طبعا وعد بالمزيد ولم يفعل/يتمكن كما يحصل معنا نحن أيضا
المصدر:
برأيك: ما الذي يمكن/ينبغي إضافته؟
النسخة المحمولة لـ Firebird متوفرة ومعروفة لدى الجميع Embedded...
في هذا الموضوع محاولة لأحدهم (من delphipraxis المكنى neo4a) لإنشاء نسخة محمولة من Firebird Server في ملف تطبيقي واحد
والنتيجة ملف وحيد يشغل خادم Firebird يكتشف ملفات قواعد البيانات التي من حوله ويضعها عرضة للاتصال من خلال IP ومنفذ، من خصائصها:
- تشغيل/اتصال متعدد
- لا حاجة لصلاحيات نظام
- رصد تلقائي لملفات قواعد البيانات
...
بغض النظر عن المنتج، دعونا نلقي نظرة على المحاكاة الافتراضية وكيف تمت:
أخذ صديقنا مجلد Firebird بحجمه (9 Mb تقريبا) ضغطه في ملف Resouces مستخدما SDK BoxedApp
كود :
http://www.boxedapp.com/boxedappsdk/#.UIEeHK7-u2w
فك الملف كما يلي:
PHP كود :
procedure TForm1.StartClick(Sender: TObject);
var s:string;path:string;
begin
path:=ExtractFilepath(Application.ExeName)+'';
if not FileExists(path+'\bin\fbclient.dll') then
CreateVirtualFile(path+'\bin\fbclient.dll','RES__BIN_FBCLIENT_DLL');
if not FileExists(path+'\bin\fbrmclib.dll') then
CreateVirtualFile(path+'\bin\fbrmclib.dll','RES__BIN_FBRMCLIB_DLL');
if not FileExists(path+'\bin\fbserver.exe') then
CreateVirtualFile(path+'\bin\fbserver.exe','RES__BIN_FBSERVER_EXE');
if not FileExists(path+'\bin\gbak.exe') then
CreateVirtualFile(path+'\bin\gbak.exe','RES__BIN_GBAK_EXE');
if not FileExists(path+'\bin\gfix.exe') then
CreateVirtualFile(path+'\bin\gfix.exe','RES__BIN_GFIX_EXE');
if not FileExists(path+'\bin\gsec.exe') then
CreateVirtualFile(path+'\bin\gsec.exe','RES__BIN_GSEC_EXE');
if not FileExists(path+'\bin\gstat.exe') then
CreateVirtualFile(path+'\bin\gstat.exe','RES__BIN_GSTAT_EXE');
if not FileExists(path+'\bin\ib_util.dll') then
CreateVirtualFile(path+'\bin\ib_util.dll','RES__BIN_IB_UTIL_DLL');
if not FileExists(path+'\bin\icudt30.dll') then
CreateVirtualFile(path+'\bin\icudt30.dll','RES__BIN_ICUDT30_DLL');
if not FileExists(path+'\bin\icuin30.dll') then
CreateVirtualFile(path+'\bin\icuin30.dll','RES__BIN_ICUIN30_DLL');
if not FileExists(path+'\bin\icuuc30.dll') then
CreateVirtualFile(path+'\bin\icuuc30.dll','RES__BIN_ICUUC30_DLL');
if not FileExists(path+'\bin\Microsoft.VC80.CRT.manifest') then
CreateVirtualFile(path+'\bin\Microsoft.VC80.CRT.manifest','RES__BIN_MICROSOFT_VC80_CRT_MANIFEST');
if not FileExists(path+'\bin\msvcp80.dll') then
CreateVirtualFile(path+'\bin\msvcp80.dll','RES__BIN_MSVCP80_DLL');
if not FileExists(path+'\bin\msvcr80.dll') then
CreateVirtualFile(path+'\bin\msvcr80.dll','RES__BIN_MSVCR80_DLL');
if not FileExists(path+'\bin\nbackup.exe') then
CreateVirtualFile(path+'\bin\nbackup.exe','RES__BIN_NBACKUP_EXE');
if not FileExists(path+'\firebird.conf') then
CreateVirtualFile(path+'\firebird.conf','RES__FIREBIRD_CONF');
if not FileExists(path+'\firebird.log') then
CreateVirtualFile(path+'\firebird.log','RES__FIREBIRD_LOG');
if not FileExists(path+'\firebird.msg') then
CreateVirtualFile(path+'\firebird.msg','RES__FIREBIRD_MSG');
if not FileExists(path+'\intl\fbintl.conf') then
CreateVirtualFile(path+'\intl\fbintl.conf','RES__INTL_FBINTL_CONF');
if not FileExists(path+'\intl\fbintl.dll') then
CreateVirtualFile(path+'\intl\fbintl.dll','RES__INTL_FBINTL_DLL');
if not FileExists(path+'\security2.fdb') then
CreateVirtualFile(path+'\security2.fdb','RES__SECURITY2_FDB');
if not FileExists(path+'\udf\fbudf.dll') then
CreateVirtualFile(path+'\udf\fbudf.dll','RES__UDF_FBUDF_DLL');
if not FileExists(path+'\udf\ib_udf.dll') then
CreateVirtualFile(path+'\udf\ib_udf.dll','RES__UDF_IB_UDF_DLL');
if not FileExists(path+'\aliases.conf') then begin
CreateVirtualFile(path+'\aliases.conf',''); //Leere Datei
CreateAliases(path+'\aliases.conf'); //Sammle die Datenbanken im Unterverzeichnis
end;
AliasListBox.Items.LoadFromFile(path+'\aliases.conf');
if AliasListBox.Items.Count>0 then begin
AliasListBox.ItemIndex:=0;
SetCS;
end;
fbserverhandle:=0;
s:=path+'\bin\fbserver.exe';
caption:=s;
if FileExists(s) then begin
Caption:=Format(Application.Title+' (gestartet auf %s)',[JvComputerInfoEx1.Identification.IPAddress]);
fbserverhandle:=ExecAndWait(s,Format(' -a -n -p %d',[PortEdit.Value])); //Starte den Child-Prozess
end;
end;
procedure TForm1.StopClick(Sender: TObject);
begin
if fbserverhandle>0 then begin
Caption:=Format(Application.Title+' (gestoppt auf %s)',[JvComputerInfoEx1.Identification.IPAddress]);
TerminateProcess(fbserverhandle, 1);
CloseHandle(fbserverhandle);
fbserverhandle:=0;
end;
end;
initialization
BoxedAppSDK_Init;
finalization
BoxedAppSDK_Exit;
الناتج ما يقارب 12Mb، أضاف إليه بعض البهارات ثم ضغطه بـ PECompact ليحصل على تطبيق 3Mb
الناتج:
كود :
http://www.mediafire.com/download.php?zl8o2zx1gw9cjyd
طبعا وعد بالمزيد ولم يفعل/يتمكن كما يحصل معنا نحن أيضا
المصدر:
كود :
http://www.delphipraxis.net/140732-portable-firebird-server-2-1-3-a.html
برأيك: ما الذي يمكن/ينبغي إضافته؟
اللهم احقن دماء المسلمين، لا تنسوهم بالدعاء...