Runtime error (at -1:0): Cannot import ISSkin.dll with InnoSetup

别来无恙 提交于 2019-12-22 20:44:10

问题


My program installs fine in my computer, which has ISSkin installed. I tried then to install my program in a different computer that has not got ISSkin installed and I get this message upon installation : "Runtime error (at -1:0): Cannot import dll:c:\Folder00\ISSkin.dll".

I searched on the net but nothing so far. I have the following code in my INNO:

[Files]
Source: "c:\Folder00\ISSkin.dll"; DestDir: {tmp}; Flags: dontcopy; Attribs: hidden system

[Code] 
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@c:\Folder00\ISSkin.dll cdecl';

procedure UnloadSkin();
external 'UnloadSkin@c:\Folder00\ISSkin.dll cdecl'

Im am using a *.cjstyles skin for the innosetup. I changed from STDCALL to CDECL but to no avail. Has anyone had this problem and how it can be solved?


回答1:


You're extracting the dll to temporary files but trying to load it from some 'c:\folder00\', which most probably won't exist in the target computer.

Follow the example on the product page and you'll be fine. Relevant pieces from the linked example:

[Files]
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
Source: Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy    

[Code] 
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall';

function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Office2007.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), '');
  Result := True;
end; 


来源:https://stackoverflow.com/questions/12360514/runtime-error-at-10-cannot-import-isskin-dll-with-innosetup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!