【发布时间】:2020-12-02 20:54:50
【问题描述】:
我们目前正在使用 Inno Setup 5.5.3 版来构建安装程序。我打算将此版本升级到 6.1.2。
我们使用 Inno Setup 来安装我们的产品。我们随安装程序一起提供许可证代码,用户在安装过程中在字段中输入许可证。 此许可证使用自定义 DLL 进行验证,DLL 返回非否定结果以获得有效许可证。 此过程在 5.5.3 和 5.6.1 中运行良好,但在版本 6 中失败(使用 6.0.5 和 6.1.2 测试)。
很遗憾,没有生成指向确切问题的日志。
这个自定义 DLL 是 32 位的,并且是在 10 多年前使用 C++ 构建的。没有计划重做这部分。有没有办法使用相同的 DLL 并解决问题?谢谢。
[Files]
Source: mydll.dll; Flags: dontcopy
// This function calls the external mydll which parses licenseCode and
// returns an integer
function getFlags( secret, licenseCode : String) : Integer;
external 'getFlags@files:mydll.dll cdecl';
function checkLicense(license : String) : Boolean;
var
secret : String;
begin
Result := False; // default is Incorrect license
license := Trim(license);
secret := <secret>
// This line calls the above getFlags function and expects to get an integer
license_flags := getFlags( secret, license);
if license_flags = -1 then begin
if not suppressMsgBox then begin
MsgBoxLog( ‘Incorrect License’)
end;
Exit;
end;
Result := True;
end;
// This is the c++ function
PS_EXPORT(int) getFlags( const char * secret, const char * license ) {
// This function is returning -1 for Inno Setup 6
// but works fine for Inno Setup 5
if (strlen(license) == 0)
return -1;
...
}
【问题讨论】:
标签: dll inno-setup inno-setup-v6