I have an InnoSetup where i Load a C# DLL. The Installer hangs up in the end of the setup. I found a thread on stackoverflow which seems to have some good informations in it, but i am to unexperienced to get the information provided...
InnoSetup hangs after install due to dll
What my DLL does is basicly:
- Unzip *.zip files in some threads
- provide feedback to innoSetup via a callback.
What in Inno happens:
- Start the Exported DLL method
- Receive the callback
- When the unzipping is done Unload the DLL.
But it seems the DLL is never unloaded. I tested it via a TimerEvent which is fired every 5 seconds and the timer never stops.
Here is a code snippet: Inno:
type
TProgressCallback=procedure(progress:Integer); // ; id : String
function WrapProgressProc(callback:TProgressCallback; paramcount:integer):longword;
external 'wrapcallback@files:innocallback.dll stdcall';
function ReadZipEx(xml:String; callback:longword): longword;
external 'ReadZipEx@{src}\data\tools\ZipLib.dll stdcall loadwithalteredsearchpath';
procedure InstallData();
var
progCallBack : longword;
begin
progCallBack := WrapProgressProc(@ProgressCallback,1);
//create xml
ReadZipEx(m_XML_String,progCallBack);
end;
procedure ProgressCallback(progress:Integer); //;id : String
begin
pbStateZip.position := progress;
lblState1.Caption := IntToStr(progress);
if(progress = 100)then begin
UnloadDLL(ExpandConstant('{src}\data\tools\ZipLib.dll'));
UnloadDLL(ExpandConstant('{tmp}\innocallback.dll'));
OperationsFinished();
end
end;
C#:
[DllExport("ReadZipEx", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
public static int ReadZipEx(string xml, ReportProgress repoProg)
{
//start threads
//start timers which fire the callback
}
Does anybody know why my setup freezes in the end and why the DLL is never unloaded or why it keeps running ? i tried to release all data which the C# part uses