I\'m getting a exception when I attempt to use my DLL from the Inno Setup script.
I think the problem is this line in the dll code:
StreamReader sre
I assume you are (correctly) using Unicode version of Inno Setup (in the latest Inno Setup 6, there's only the Unicode version)
In the Unicode version of Inno Setup, string
is a wide string. For the wide string, you need to use UnmanagedType.LPWStr
, not UnmanagedType.LPStr
.
UnmanagedType.LPStr
is an Ansi string – an equivalent of AnsiString
in Inno Setup and string
in the Ansi version of Inno Setup.
Though as @mirtheil commented already, replacing a string in a text file can easily be implemented in Pascal Script: Replace a text in a file with Inno Setup.