如何在Inno Setup中将VCL样式应用于基于DLL的表单进行卸载?无法导入dll [英] How to apply VCL Styles to DLL-based forms in Inno Setup for uninstall? Cannot Import dll
问题描述
我正在尝试为安装程序添加VCL样式(Inno Setup 5.5.6(a)).样式在安装过程中正确加载,但是当我尝试卸载时出现错误
I'm trying to add VCL styles (Inno Setup 5.5.6 (a)) for my installer. Style load correctly during the installation, but when I try to uninstall I get an error
运行时错误(at-1:0):无法导入dll:VclStylesInno.dll.
Runtime Error(at-1:0): Cannot Import dll:VclStylesInno.dll.
我无法卸载程序.
有人知道我能做什么吗?
感谢您的帮助
Does anyone know what I can do?
Thanks for the help
#define VCLStylesSkinPath "{localappdata}\VCLStylesSkin"
[Files]
;Install
Source: "VclStylesinno.dll"; DestDir: "{app}"; Flags: dontcopy
Source: "Styles\Auric.vsf"; DestDir: "{app}"; Flags: dontcopy
;Uninstall
Source: "VclStylesinno.dll"; DestDir: "{#VCLStylesSkinPath}"; Flags: uninsneveruninstall
Source: "Styles\Auric.vsf"; DestDir: "{#VCLStylesSkinPath}"; Flags: uninsneveruninstall
[Code]
{ Import the LoadVCLStyle function from VclStylesInno.DLL }
procedure LoadVCLStyle(VClStyleFile: String);
external 'LoadVCLStyleA@files:VclStylesInno.dll stdcall setuponly';
procedure LoadVCLStyle_UnInstall(VClStyleFile: String);
external 'LoadVCLStyleA@VclStylesInno.dll stdcall uninstallonly';
{ Import the UnLoadVCLStyles function from VclStylesInno.DLL }
procedure UnLoadVCLStyles;
external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall setuponly';
procedure UnLoadVCLStyles_UnInstall;
external 'UnLoadVCLStyles@VclStylesInno.dll stdcall uninstallonly';
function InitializeUninstall: Boolean;
begin
Result := True;
LoadVCLStyle_UnInstall(ExpandConstant('Styles\Auric.vsf'));
end;
procedure DeinitializeUninstall();
begin
UnLoadVCLStyles_UnInstall;
end;
推荐答案
您未指定VclStylesInno.dll
的卸载副本的路径.
You are not specifying a path to the uninstall copy of the VclStylesInno.dll
.
这是正确的方法:
procedure LoadVCLStyle_UnInstall(VClStyleFile: String);
external 'LoadVCLStyleA@{#VCLStylesSkinPath}\VclStylesInno.dll stdcall uninstallonly';
下次,只需遵循官方有关为Inno Setup卸载VCL样式的说明.
有关详细信息,甚至可能比官方解决方案更好的解决方案,另请参见加载外部DLL,以在Inno Setup中进行卸载过程.
For more details and maybe even a better solution than the official one, see also Load external DLL for uninstall process in Inno Setup.
这篇关于如何在Inno Setup中将VCL样式应用于基于DLL的表单进行卸载?无法导入dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!