본문으로 바로가기

Innosetup 기본 포멧

category Package/innosetup 2019. 7. 28. 12:43
728x90
#define MyAppName "coomonkey" //프로그램 이름을 정의함
#ifndef MyBuildNumber //Jenkins의 BuildNumber를 받아옴 (Jenkins에서 BuildNumber를 넘겨주어야 함)
	#define MyBuildNumber "0"//parameter를 따로 받지 못했을 경우 0
#endif
#ifndef Version //릴리즈 버전을 Jenkins에서 입력받아옴
	#define Version "0"//parameter를 따로 받지 못했을 경우 0
#endif
#define MyAppVersion Version //프로그램 버전에 CSVersion을 입력
#define MyAppPublisher "coomonkey" //배포자 (프로그램의 About에 해당 정보가 들어감)
#define MyAppURL "https://github.com/coomonkey" //URL(프로그램의 About에 해당 정보가 들어감)
#define MyDefaultFolderName "coomonkey\test" //설치 될 Default 폴더 경로
#ifndef MyBranch //소스의 Branch (Backup 폴더를 찾기 위함)
	#define MyBranch "\origin\master"
#endif
#define ConsoleOutputPathx86 "D:\publish\coomonkey\x86\" + MyBranch + "\latest"
#define ConsoleOutputPathx64 "D:\publish\coomonkey\x64\" + MyBranch + "\latest"
#define ConsoleExecutableName "coomonkey.exe" //설치 후 바로가기 아이콘 이름


[Setup]
AppId={{8B39C4EA-76E7-4E8D-9A67-A3E1B3515E07} //해당 번호는 registry에 등록됨, 따라서 다른 패키지에서 중복적으로 사용하게되면 같은 패키지로 인지하게 되버림
AppName={#MyAppName} 
AppVersion={#MyAppVersion} 
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher} 
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyDefaultFolderName} //{pf}=C:\Program Files, 설치 될 Default Directory 정의
DefaultGroupName={#MyDefaultFolderName} //시작메뉴에 FolderName 정의
VersionInfoVersion={#MyAppVersion}
VersionInfoCopyright=Copyright @ {#MyAppPublisher}
AllowNoIcons=yes
OutputDir=x64\Output //패키징 결과물이 생성될 경로
OutputBaseFilename={#MyAppName} {#MyAppVersion} //패키지 파일의 이름
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=no
DisableDirPage=no
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64 //허용 가능한 비트
RestartIfNeededByRun=yes //재시작 필요 유무를 물음
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
WindowVisible=yes
AppCopyright={#MyAppPublisher}
BackColor=clBlack
BackColor2=clSilver
WizardImageStretch=no
PrivilegesRequired=Admin //프로그램이 admin 권한으로 설치됨

//패키지 설치 과정 언어 설정
[Languages]
Name: en; MessagesFile: compiler:Default.isl
Name: ko; MessagesFile: compiler:Languages\Korean.isl

//설치시 표시할 언어 메세지 설정
[Messages]
en.BeveledLabel=English
ko.BeveledLabel=Korean

[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#ConsoleExecutableName}"; WorkingDir: {app}; //바탕화면에 바로가기 아이콘 생성
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#ConsoleExecutableName}"; WorkingDir: {app}; //시작메뉴에 바로가기 아이콘 생성

//패키징 될 파일 리스트 작성
[Files]
//심볼릭 링크를 걸어둔 latest 파일을 패키징 함
Source: "{#ConsoleOutputPathx64}\*"; DestDir: {app}; Excludes: "*.pdb,*.vshost.*"; Flags: recursesubdirs ignoreversion createallsubdirs; Check: Is64BitinstallMode //x64일때
Source: "{#ConsoleOutputPathx86}\*"; DestDir: {app}; Excludes: "*.pdb,*.vshost.*"; Flags: recursesubdirs ignoreversion createallsubdirs; Check: not Is64BitInstallMode //x86일때
//ignoreversion : 버전 무시
//recuresesubdirs : 하위폴더도 패키징
//createallsubdirs : 하위폴더 없을 경우 생성
//overwritereadonly : 쓰기금지된 파일도 엎어쓰기

[Registry]
//registry에 등록
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"; ValueType: dword; ValueName: "{#ConsoleExecutableName}"; ValueData: 0x2711; Flags: deletevalue uninsdeletevalue;
Root: HKLM; Subkey: "SOFTWARE\coomonkey\Version"; ValueType: string; ValueName: "Viewer"; ValueData: "{#MyAppVersion}"; Flags: deletevalue uninsdeletevalue;

//설치 시 실행해야 하는 파일 실행
[Run]
Filename: "{app}\firewall.vbs"; Flags: runascurrentuser shellexec waituntilterminated skipifdoesntexist
//runascurrentuser : admin 권한으로 실행
//shellexec : cmd, exe 파일이 아닌경우 해당 flag 추가해야 함
//waituntilterminated : 해당 terminal이 끝날때까지 기다림
//skipifdoesntexist : 파일이 존재하지 않아도 error 메세지를 띄위지 않음


//삭제할 때 실행할 파일
[UninstallRun]
Filename: "{app}\firewall_uninstall.vbs"; Flags: runascurrentuser shellexec waituntilterminated skipifdoesntexist

'Package > innosetup' 카테고리의 다른 글

innosetup page 종류  (0) 2019.12.13
StringChange / StringChangeEx  (0) 2019.12.11
Exec / ShellExec  (0) 2019.12.10
Radio Button  (0) 2019.07.28
64bit 32bit packaging  (0) 2019.07.28