Inno Setup: An attempt was made to access WizardForm before it has been created

У меня такой код.

procedure DeinitializeSetup();
begin
UnLoadVCLStyles;
if FileExists(ExpandConstant('{tmp}\') + 'botva2.dll') then gdipShutDown();
WizardForm.Free;
end;

Когда я закрываю окно выбора языка выходит такая ошибка. Я понимаю, что ошибка вылезает, потому-что WizardForm не создана. Как сделать, что бы не было ошибки, но что-бы WizardForm.Free осталась в procedure DeinitializeSetup()?


Ответы (1 шт):

Автор решения: Иван Иваныч

Добавил в код вместо WizardForm.Free такие строчки и окно инсталлятора, в котором скин .vsf стало закрываться быстро.

[code]

function ShowWindow(hWnd: Integer; uType: Integer): Integer; external '[email protected] stdcall';

procedure DeinitializeSetup();
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
if FileExists(ExpandConstant('{tmp}\') + 'botva2.dll') then gdipShutDown();
UnLoadVCLStyles;
end;
→ Ссылка