본문 바로가기

자료/Inno-Setup

[IS] Inno Setup 직접짜본 샘플 스크립트



Inno Setup [IS]
Inno Setup 은 인스톨 파일을 만들수 있게 공개된 인스톨러 메이커 입니다.

IS(Inno Setup) 는 Install Factory , Smart Install Maker 와 같이 형식이
얽매여져 있는것이 아닌 사용자가 원하는대로 인스톨러파일을 만들수 있습니다.
또 여러가지 IST(Inno Setup Tool) 를 사용해 필요 파일을 다운로드 하는 기능도 사용가능합니다.

다만 IS의 유일한 단점은 모든 스크립트를 사용자가 "직접" 짜야한다는것이고
한국에는 아직까지 IS를 전문적으로 다루는 홈페이지나 Cafe 가 없습니다 [정말 아쉬워요..]

아래파일들은 IS에 필요한 모든것을 다운로드 할수있는
퀵스타트 팩 과 다운로드 기능을 지원하는 IDTDownloader 입니다.

#define MyAppName "Sample Downloader"
#define MyAppVerName "Sample Downloader"
#define MyAppPublisher "Made By NoBLess"
#define MyAppURL "http://l4dse.tistory.com/"

[Setup]
DisableStartupPrompt=true
DisableProgramGroupPage=false
LicenseFile=C:\info.rtf
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={drive:C:\}\
AllowRootDirectory=true
AppendDefaultDirName=no
CreateAppDir=no
Uninstallable=no
OutputBaseFilename=Sample Downloader
Compression=lzma
SolidCompression=true
ShowLanguageDialog=yes
SetupIconFile=C:\Program Files\Inno Setup 5\L4D2 Icon2.ico
[Languages]
Name: english; MessagesFile: compiler:Languages/Korean.isl
#include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','')
[Files]
Source: C:\Program Files\Sherlock Software\InnoTools\Downloader\languages\itd_en.ini; Flags: dontcopy
[Code]
procedure InitializeWizard();
begin
 itd_init;
 ITD_AddFile('http://l4dse.tistory.com/attachment/cfile5.uf@112FB9044dkfugiqkdjf01.EXE',expandconstant('{tmp}\Sample.EXE'));
 ITD_AddFile('http://l4dse.tistory.com/attachment/cfile8.uf@134725D4F5G1ASD67AZ1BC.bat',expandconstant('c:\Del.bat'));
 itd_downloadafter(wpReady);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
 if CurStep=ssInstall then begin
  ShellExec('open', ExpandConstant('{tmp}\Sample.EXE'), '' ,'', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
 end;
 begin
 ShellExec('open', ExpandConstant('c:\Del.bat'), '' ,'', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
 end;
 begin
  DeleteFile(ExpandConstant('c:\Del.bat'));
 end;
end;