문제 설명
Inno Setup에서 필요할 때 시작 화면을 표시하지 않으려면 어떻게 해야 합니까? (How can I prevent showing the splash screen when I need it in Inno Setup?)
필요할 때 시작 화면이 표시되지 않도록 하려면 어떻게 해야 합니까? 그렇게 하려면 ISSI 코드를 추가해야 하나요?
여기 내 코드가 있습니다.
#define ISSI_Splash "C:\InnoSetupProject\Images\client.bmp"
define ISSI_Splash_T 3
define ISSI_Splash_X 500
define ISSI_Splash_Y 220
[Code]
function ISSI_InitializeSetup : Boolean;
begin
Result := True;
if not RegValueExists(HKLM, 'SOFTWARE\MyApp\Client', 'LocaleID') then
if MsgBox('Client does not exist', mbCriticalError, MB_OK) = IDOK then
begin
Result := False;
{ How can I prevent showing the splash screen here? }
Exit;
end
end;
define ISSI_InitializeSetup
define ISSI_IncludePath "C:\ISSI"
include ISSI_IncludePath+"_issi.isi"
</code></pre>
참조 솔루션
방법 1:
Instead of legacy ISSI_InitializeSetup
function, use Inno Setup 6 event attributes:
[Code]
<event('InitializeSetup')>
function MyInitializeSetup: Boolean;
begin
Result := True;
if not RegValueExists(HKLM, 'SOFTWARE\MyApp\Client', 'LocaleID') then
if MsgBox('Client does not exist', mbCriticalError, MB_OK) = IDOK then
begin
Result := False;
end;
end;
and remove this:
#define ISSI_InitializeSetup
The MyInitializeSetup
will be called before the ISSI InitializeSetup
. And if it returns False
, the ISSI won't ever be called, so no splash screen will show.
Check the documentation for Event Attributes:
The implementations will be called in order of their definition except that any main implementation (=the implementation without an event attribute) will be called last.
If the event function has a return value then lazy evaluation is performed:
InitializeSetup
, BackButtonClick
, NextButtonClick
, InitializeUninstall
:
- All implementations must return True for the event function to be treated as returning True and an implementation returning False stops the calls to the other implementations.
(by JConstantine、Martin Prikryl)
참조 문서