关于减少CEF的图书馆规模,需要全面重建,并需要一些缩编阶段。 根据今天的计算机动力和网络带宽,花费了大量时间,也许不值得使用——40个甲基溴是小的。 而我则依靠欧洲紧急部队的“官方”释放,以保持最新版本的浏览器。
如果贵问题涉及一揽子部署的规模和单一可执行/无安装特征,你可考虑将<代码>dll列入exe
。
The trick I ve used is that the .dll
files are stored as zip inside the main .exe
, then uncompressed on a private temporary folder on the hard drive (you may want to use the same folder, but it won t work in C:Program Files
due to the Vista/Seven UAC, and your user may wonder where all those files comes frome - that is the reason why I use a private folder).
From the user point of view, there is just one executable file to run. All .dll
files are compressed within, and you can also add some non-binary resources to the files (which is not possible with exe/dll compactors). An hidden folder is created and used to load the libraries (which must be loaded with LoadLibrary()
, not statically linked), and decompression will be done only once (therefore it will be faster than using an exe/dll compressor).
例如,我用它把藏书图书馆和英文字典植入我们的Syn Project工具。 法典如下:
constructor THunSpell.Create(DictionaryName: string= );
var Temp, HunSpell, Aff, Dic: TFileName;
i: integer;
begin
if DictionaryName= then
DictionaryName := en_US ;
Temp := GetSynopseCommonAppDataPath;
HunSpell := Temp+ hunspell.dll ;
with TZipRead.Create(HInstance, Zip , ZIP ) do
try
Aff := DictionaryName+ .aff ;
if not FileExists(Temp+Aff) then
StringToFile(Temp+Aff,UnZip(NameToIndex(Aff)));
Dic := DictionaryName+ .dic ;
if not FileExists(Temp+Dic) then
StringToFile(Temp+Dic,UnZip(NameToIndex(Dic)));
if not FileExists(HunSpell) then
StringToFile(HunSpell,UnZip(NameToIndex( hunspell.dll )));
finally
Free;
end;
fHunLib := SafeLoadLibrary(HunSpell);
if fHunLib=0 then
exit;
if not LoadEntryPoints then begin
FreeLibrary(fHunLib);
fHunLib := 0;
exit;
end;
fDictionaryName := DictionaryName;
fHunHandle := Hunspell_create(pointer(Temp+Aff),pointer(Temp+Dic));
if fHunHandle=nil then
exit;
(....)
end;
See this link about details and source code.
您可考虑使用一些低水平的黑板,如BTMemory Module,但你得起任何可能的压缩。