Initial checkin of Pika from heckimp

This commit is contained in:
2023-09-25 15:35:21 -07:00
commit 891e999216
6761 changed files with 5240685 additions and 0 deletions

View File

@ -0,0 +1,60 @@
#if 0
[Files]
#endif
//process list of 32bit PIKA files that are installed on x64 (for TWAIN support)
#pragma option -e-
#define protected
#define FileHandle
#define FileLine
#define ReplPos
#define ReplStr
#define Line=0
#define SRC_DIR PIKA_DIR32
//avoid too much nesting
#sub DoActualWork
#if Copy(FileLine,Len(FileLine),1)=="\"
//include whole directory
Source: "{#SRC_DIR}\{#FileLine}*"; DestDir: "{app}\32\{#Copy(FileLine,1,Len(FileLine)-1)}"; Components: pika32on64; Flags: recursesubdirs restartreplace replacesameversion uninsrestartdelete ignoreversion
#else
//include files from a certain directory
#define OutputDir Copy(FileLine,1,RPos("\",FileLine)-1)
Source: "{#SRC_DIR}\{#FileLine}"; DestDir: "{app}\32\{#OutputDir}"; Components: pika32on64; Flags: restartreplace replacesameversion uninsrestartdelete ignoreversion
#endif
#endsub
#sub Process32on64Line
#if !defined(Finished)
//show that something's happening
#expr Line=Line+1
#pragma message "Processing 32on64.list line " + Str(Line)
#if Copy(FileLine,1,1)=="#" || FileLine==""
//skip comments and empty lines
#elif Copy(FileLine,1,1)=="!"
#if Copy(FileLine,2)=="PIKA"
#expr SRC_DIR=PIKA_DIR32
#elif Copy(FileLine,2)=="GTK"
#expr SRC_DIR=DEPS_DIR32
#elif Copy(FileLine,2)=="end"
#define public Finished 1
//finished
#else
#error "Unknown command: "+FileLine
#endif
#else
#expr DoActualWork
#endif
#endif
#endsub
#for {FileHandle = FileOpen(AddBackslash(SourcePath)+"32on64.list"); \
FileHandle && !FileEof(FileHandle); FileLine = FileRead(FileHandle)} \
Process32on64Line
#if FileHandle
#expr FileClose(FileHandle)
#endif

View File

@ -0,0 +1,15 @@
#list of 32bit files to install on x64
!GTK
etc\fonts\
#lib\gtk-2.0\2.10.0\loaders\*.dll
#lib\gtk-2.0\modules\*.dll
lib\gdk-pixbuf-2.0\2.10.0\loaders\*.dll
lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
lib\babl-0.1\*.dll
lib\gegl-0.4\*.dll
share\themes\
bin\gspawn*.exe
bin\*.dll
!PIKA
bin\*.dll
!end

View File

@ -0,0 +1,504 @@
[Code]
(* MessageWithURL
*
* Copyright (c) 2010-2011 Jernej Simončič
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must
* not claim that you wrote the original software. If you use this
* software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must
* not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*)
(* * * * * * * * * *
* MessageWithURL(Message: TArrayOfString; Title: String: ButtonText: TArrayOfString; Typ: TMsgBoxType;
* DefaultButton, CancelButton: Integer): Integer;
*
* Parameters:
* Title dialog box caption
* Message messages to display; if a message starts with _, the text following it up to the first space character
* is interpreted as URL, and the rest of the message is used as clickable text for that URL
* Typ icon to show
* ButtonText buttons to show under the text
* DefaultButton default button (first button = 1)
* CancelButton cancel button (first button = 1)
*
* Return value button that was clicked (first button = 1); if running in silent mode, DefaultButton is returned
*)
function MessageWithURL(Message: TArrayOfString; const Title: String; ButtonText: TArrayOfString; const Typ: TMsgBoxType;
const DefaultButton, CancelButton: Integer): Integer; forward;
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@User32 stdcall';
function GetDialogBaseUnits(): Integer; external 'GetDialogBaseUnits@User32 stdcall';
//function GetSysColor(nIndex: Integer): DWORD; external 'GetSysColor@user32.dll stdcall';
function LoadIcon(hInstance: Integer; lpIconName: Integer): Integer; external 'LoadIconW@user32 stdcall';
//function LoadImage(hinst: Integer; lpszName: Integer; uType: Cardinal; cxDesired, cyDesired: Integer; fuLoad: Cardinal): Integer; external 'LoadImageW@user32 stdcall';
function DrawIcon(hdc: HBitmap; x,y: Integer; hIcon: Integer): Integer; external 'DrawIcon@user32 stdcall';
//function DrawIconEx(hdc: HBitmap; xLeft,yTop: Integer; hIcon: Integer; cxWidth, cyWidth: Integer; istepIfAniCur: Cardinal; hbrFlickerFreeDraw: Integer; diFlags: Cardinal): Integer; external 'DrawIconEx@user32 stdcall';
//function DestroyIcon(hIcon: Integer): Integer; external 'DestroyIcon@user32 stdcall';
function DrawFocusRect(hDC: Integer; var lprc: TRect): BOOL; external 'DrawFocusRect@user32 stdcall';
type
TArrayOfButton = Array of TNewButton;
const
//borders around message
MWU_LEFTBORDER = 25;
MWU_RIGHTBORDER = MWU_LEFTBORDER;
MWU_TOPBORDER = 26;
MWU_BOTTOMBORDER = MWU_TOPBORDER;
//space between elements (icon-text and between buttons)
MWU_HORZSPACING = 8;
//space between labels
MWU_VERTSPACING = 4;
//button sizes
MWU_BUTTONHEIGHT = 24;
MWU_MINBUTTONWIDTH = 86;
//height of area where buttons are placed
MWU_BUTTONAREAHEIGHT = 45;
SM_CXSCREEN = 0;
SM_CXICON = 11;
SM_CYICON = 12;
SM_CXICONSPACING = 38;
SM_CYICONSPACING = 39;
//COLOR_HOTLIGHT = 26;
OIC_HAND = 32513;
OIC_QUES = 32514;
OIC_BANG = 32515;
OIC_NOTE = 32516;
LR_DEFAULTSIZE = $00000040;
LR_SHARED = $00008000;
IMAGE_BITMAP = 0;
IMAGE_ICON = 1;
IMAGE_CURSOR = 2;
DI_IMAGE = 1;
DI_MASK = 2;
DI_NORMAL = DI_IMAGE or DI_MASK;
DI_DEFAULTSIZE = 8;
var
URLList: TArrayOfString;
TextLabel: Array of TNewStaticText;
URLFocusImg: Array of TBitmapImage;
SingleLineHeight: Integer;
procedure UrlClick(Sender: TObject);
var ErrorCode: Integer;
begin
ShellExecAsOriginalUser('open',URLList[TNewStaticText(Sender).Tag],'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
// calculates maximum width of text labels
// also counts URLs, and sets the length of URLList accordingly
function Message_CalcLabelWidth(var Message: TArrayOfString; MessageForm: TSetupForm): Integer;
var MeasureLabel: TNewStaticText;
i,URLCount,DlgUnit,ScreenWidth: Integer;
begin
MeasureLabel := TNewStaticText.Create(MessageForm);
with MeasureLabel do
begin
Parent := MessageForm;
Left := 0;
Top := 0;
AutoSize := True;
end;
MeasureLabel.Caption := 'X';
SingleLineHeight := MeasureLabel.Height;
Result := 0; //minimum width
URLCount := 0;
for i := 0 to GetArrayLength(Message) - 1 do
begin
if Length(Message[i]) < 1 then //simplifies things
Message[i] := ' ';
if Message[i][1] <> '_' then
MeasureLabel.Caption := Message[i] //not an URL
else
begin //URL - check only the displayed text
if Pos(' ',Message[i]) > 0 then
MeasureLabel.Caption := Copy(Message[i],Pos(' ',Message[i])+1,Length(Message[i]))
else
MeasureLabel.Caption := Copy(Message[i],2,Length(Message[i]));
URLCount := URLCount + 1;
end;
if MeasureLabel.Width > Result then
Result := MeasureLabel.Width;
end;
MeasureLabel.Free;
SetArrayLength(URLList,URLCount); //needed later - no need to do a special loop just for this
SetArrayLength(URLFocusImg,URLCount);
DlgUnit := GetDialogBaseUnits() and $FFFF; //ensure the dialog isn't too wide
ScreenWidth := GetSystemMetrics(SM_CXSCREEN);
if Result > ((278 * DlgUnit) div 4) then //278 is from http://blogs.msdn.com/b/oldnewthing/archive/2011/06/24/10178386.aspx
Result := ((278 * DlgUnit) div 4);
if Result > (ScreenWidth * 3) div 4 then
Result := (ScreenWidth * 3) div 4;
end;
//find the longest button
function Message_CalcButtonWidth(const ButtonText: TArrayOfString; MessageForm: TSetupForm): Integer;
var MeasureLabel: TNewStaticText;
i: Integer;
begin
MeasureLabel := TNewStaticText.Create(MessageForm);
with MeasureLabel do
begin
Parent := MessageForm;
Left := 0;
Top := 0;
AutoSize := True;
end;
Result := ScaleX(MWU_MINBUTTONWIDTH - MWU_HORZSPACING * 2); //minimum width
for i := 0 to GetArrayLength(ButtonText) - 1 do
begin
MeasureLabel.Caption := ButtonText[i]
if MeasureLabel.Width > Result then
Result := MeasureLabel.Width;
end;
MeasureLabel.Free;
Result := Result + ScaleX(MWU_HORZSPACING * 2); //account for borders
end;
procedure Message_Icon(const Typ: TMsgBoxType; TypImg: TBitmapImage);
var TypRect: TRect;
Icon: THandle;
TypIcon: Integer;
begin
TypRect.Left := 0;
TypRect.Top := 0;
TypRect.Right := GetSystemMetrics(SM_CXICON);
TypRect.Bottom := GetSystemMetrics(SM_CYICON);
case Typ of
mbInformation:
TypIcon := OIC_NOTE;
mbConfirmation:
TypIcon := OIC_QUES;
mbError:
TypIcon := OIC_BANG;
else
TypIcon := OIC_HAND;
end;
//TODO: icon loads with wrong size when using Large Fonts (SM_CXICON/CYICON is 40, but 32x32 icon loads - find out how to get the right size)
Icon := LoadIcon(0,TypIcon);
//Icon := LoadImage(0,TypIcon,IMAGE_ICON,0,0,LR_SHARED or LR_DEFAULTSIZE);
with TypImg do
begin
Left := ScaleX(MWU_LEFTBORDER);
Top := ScaleY(MWU_TOPBORDER);
Center := False;
Stretch := False;
AutoSize := True;
Bitmap.Width := GetSystemMetrics(SM_CXICON);
Bitmap.Height := GetSystemMetrics(SM_CYICON);
Bitmap.Canvas.Brush.Color := TPanel(Parent).Color;
Bitmap.Canvas.FillRect(TypRect);
DrawIcon(Bitmap.Canvas.Handle,0,0,Icon); //draws icon scaled
//DrawIconEx(Bitmap.Canvas.Handle,0,0,Icon,0,0,0,0,DI_NORMAL {or DI_DEFAULTSIZE}); //draws icon without scaling
end;
//DestroyIcon(Icon); //not needed with LR_SHARED or with LoadIcon
end;
procedure Message_SetUpURLLabel(URLLabel: TNewStaticText; const Msg: String; const URLNum: Integer);
var Blank: TRect;
begin
with URLLabel do
begin
if Pos(' ',Msg) > 0 then
begin
Caption := Copy(Msg,Pos(' ',Msg)+1,Length(Msg));
URLList[URLNum] := Copy(Msg, 2, Pos(' ',Msg)-1);
end
else
begin //no text after URL - display just URL
URLList[URLNum] := Copy(Msg, 2, Length(Msg));
Caption := URLList[URLNum];
end;
Hint := URLList[URLNum];
ShowHint := True;
Font.Color := GetSysColor(COLOR_HOTLIGHT);
Font.Style := [fsUnderline];
Cursor := crHand;
OnClick := @UrlClick;
Tag := URLNum; //used to find the URL to open and bitmap to draw focus rectangle on
if Height = SingleLineHeight then //shrink label to actual text width
WordWrap := False;
TabStop := True; //keyboard accessibility
TabOrder := URLNum;
end;
URLFocusImg[URLNum] := TBitmapImage.Create(URLLabel.Parent); //focus rectangle needs a bitmap - prepare it here
with URLFocusImg[URLNum] do
begin
Left := URLLabel.Left - 1;
Top := URLLabel.Top - 1;
Stretch := False;
AutoSize := True;
Parent := URLLabel.Parent;
Bitmap.Width := URLLabel.Width + 2;
Bitmap.Height := URLLabel.Height + 2;
SendToBack;
Blank.Left := 0;
Blank.Top := 0;
Blank.Right := Width;
Blank.Bottom := Height;
Bitmap.Canvas.Brush.Color := TPanel(Parent).Color;
Bitmap.Canvas.FillRect(Blank);
end;
end;
procedure Message_SetUpLabels(Message: TArrayOfString; TypImg: TBitmapImage;
const DialogTextWidth: Integer; MessagePanel: TPanel);
var i,URLNum,dy: Integer;
begin
SetArrayLength(TextLabel,GetArrayLength(Message));
URLNum := 0;
for i := 0 to GetArrayLength(TextLabel) - 1 do
begin
TextLabel[i] := TNewStaticText.Create(MessagePanel);
with TextLabel[i] do
begin
Parent := MessagePanel;
Left := TypImg.Left + TypImg.Width + ScaleX(MWU_HORZSPACING);
if i = 0 then
Top := TypImg.Top
else
Top := TextLabel[i-1].Top + TextLabel[i-1].Height + ScaleY(MWU_VERTSPACING);
WordWrap := True;
AutoSize := True;
Width := DialogTextWidth;
if Message[i][1] <> '_' then
Caption := Message[i]
else
begin // apply URL formatting
Message_SetUpURLLabel(TextLabel[i], Message[i], URLNum);
URLNum := URLNum + 1;
end;
end;
end;
i := GetArrayLength(TextLabel) - 1;
if TextLabel[i].Top + TextLabel[i].Height < TypImg.Top + TypImg.Height then //center labels vertically
begin
dy := (TypImg.Top + TypImg.Height - TextLabel[i].Top - TextLabel[i].Height) div 2;
for i := 0 to GetArrayLength(TextLabel) - 1 do
TextLabel[i].Top := TextLabel[i].Top + dy;
end;
end;
procedure Message_SetUpButtons(var Button: TArrayOfButton; ButtonText: TArrayOfString;
const ButtonWidth, DefaultButton, CancelButton: Integer; MessageForm: TSetupForm);
var i: Integer;
begin
SetArrayLength(Button,GetArrayLength(ButtonText));
for i := 0 to GetArrayLength(Button) - 1 do
begin
Button[i] := TNewButton.Create(MessageForm);
with Button[i] do
begin
Parent := MessageForm;
Width := ButtonWidth;
Height := ScaleY(MWU_BUTTONHEIGHT);
if i = 0 then
begin
Left := MessageForm.ClientWidth - (ScaleX(MWU_HORZSPACING) + ButtonWidth) * GetArrayLength(ButtonText);
Top := MessageForm.ClientHeight - ScaleY(MWU_BUTTONAREAHEIGHT) +
ScaleY(MWU_BUTTONAREAHEIGHT - MWU_BUTTONHEIGHT) div 2;
end else
begin
Left := Button[i-1].Left + ScaleX(MWU_HORZSPACING) + ButtonWidth;
Top := Button[i-1].Top;
end;
Caption := ButtonText[i];
ModalResult := i + 1;
//set the initial focus to the default button
TabOrder := ((i - (DefaultButton - 1)) + GetArrayLength(Button)) mod (GetArrayLength(Button));
if DefaultButton = i + 1 then
Default := True;
if CancelButton = i + 1 then
Cancel := True;
end;
end;
end;
//find out if URL label has focus
//draw focus rectangle around it if so and return index of focused label
function Message_FocusLabel(): Integer;
var i: Integer;
FocusRect: TRect;
begin
Result := -1;
for i := 0 to GetArrayLength(URLFocusImg) - 1 do //clear existing focus rectangle
begin
FocusRect.Left := 0;
FocusRect.Top := 0;
FocusRect.Right := URLFocusImg[i].Bitmap.Width;
FocusRect.Bottom := URLFocusImg[i].Bitmap.Height;
URLFocusImg[i].Bitmap.Canvas.FillRect(FocusRect);
end;
for i := 0 to GetArrayLength(TextLabel) - 1 do
begin
if TextLabel[i].Focused then
begin
Result := i;
FocusRect.Left := 0;
FocusRect.Top := 0;
FocusRect.Right := URLFocusImg[TextLabel[i].Tag].Bitmap.Width;
FocusRect.Bottom := URLFocusImg[TextLabel[i].Tag].Bitmap.Height;
DrawFocusRect(URLFocusImg[TextLabel[i].Tag].Bitmap.Canvas.Handle, FocusRect);
end;
end;
end;
//TNewStaticText doesn't have OnFocus - handle that here
//(not perfect - if you focus label with keyboard, then focus a button with mouse, the label keeps it's underline)
procedure Message_KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
var URLIdx: Integer;
begin
case Key of
9,37..40: //tab, arrow keys
begin
Message_FocusLabel();
end;
13,32: //enter, spacebar
begin
URLIdx := Message_FocusLabel(); //get focused label
if URLIdx > -1 then
UrlClick(TextLabel[URLIdx]);
end;
end;
end;
function MessageWithURL(Message: TArrayOfString; const Title: String; ButtonText: TArrayOfString; const Typ: TMsgBoxType;
const DefaultButton, CancelButton: Integer): Integer;
var MessageForm: TSetupForm;
Button: TArrayOfButton;
DialogTextWidth, ButtonWidth: Integer;
MessagePanel: TPanel;
TypImg: TBitmapImage;
i: Integer;
begin
if (not IsUninstaller and WizardSilent) or (IsUninstaller and UninstallSilent) then
begin
Result := DefaultButton;
exit;
end;
MessageForm := CreateCustomForm();
MessageForm.Caption := Title;
if (CancelButton = 0) or (CancelButton > GetArrayLength(ButtonText)) then //no cancel button - remove close button
MessageForm.BorderIcons := MessageForm.BorderIcons - [biSystemMenu];
MessagePanel := TPanel.Create(MessageForm); //Vista-style background
with MessagePanel do
begin
Parent := MessageForm;
BevelInner := bvNone;
BevelOuter := bvNone;
BevelWidth := 0;
ParentBackground := False;
Color := clWindow;
Left := 0;
Top := 0;
end;
DialogTextWidth := Message_CalcLabelWidth(Message, MessageForm);
ButtonWidth := Message_CalcButtonWidth(ButtonText, MessageForm);
TypImg := TBitmapImage.Create(MessagePanel);
TypImg.Parent := MessagePanel;
Message_Icon(Typ, TypImg);
Message_SetUpLabels(Message, TypImg, DialogTextWidth, MessagePanel);
i := GetArrayLength(TextLabel) - 1;
MessagePanel.ClientHeight := TextLabel[i].Top + TextLabel[i].Height + ScaleY(MWU_BOTTOMBORDER);
MessagePanel.ClientWidth := DialogTextWidth + TypImg.Width + TypImg.Left + ScaleX(MWU_HORZSPACING + MWU_RIGHTBORDER);
if MessagePanel.ClientWidth <
(ButtonWidth + ScaleX(MWU_HORZSPACING)) * GetArrayLength(ButtonText) + ScaleX(MWU_HORZSPACING) then //ensure buttons fit
MessagePanel.ClientWidth := (ButtonWidth + ScaleX(MWU_HORZSPACING)) * GetArrayLength(ButtonText) + ScaleX(MWU_HORZSPACING);
MessageForm.ClientWidth := MessagePanel.Width;
MessageForm.ClientHeight := MessagePanel.Height + ScaleY(MWU_BUTTONAREAHEIGHT);
Message_SetUpButtons(Button, ButtonText, ButtonWidth, DefaultButton, CancelButton, MessageForm);
MessageForm.OnKeyUp := @Message_KeyUp; //needed for keyboard access of URL labels
MessageForm.KeyPreView := True;
Result := MessageForm.ShowModal;
for i := 0 to GetArrayLength(TextLabel) - 1 do
TextLabel[i].Free;
SetArrayLength(TextLabel,0);
for i := 0 to GetArrayLength(URLFocusImg) - 1 do
URLFocusImg[i].Free;
SetArrayLength(URLFocusImg,0);
MessageForm.Release;
end;

View File

@ -0,0 +1,52 @@
[Registry]
#pragma option -e-
#define protected
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "PIKA"
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\bin\pika-{#MAJOR}.{#MINOR}.exe,1"
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\pika-{#MAJOR}.{#MINOR}.exe"" ""%1"""
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities"; ValueType: string; ValueName: "ApplicationName"; ValueData: "PIKA"
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities"; ValueType: string; ValueName: "ApplicationIcon"; ValueData: "{app}\bin\pika-{#MAJOR}.{#MINOR}.exe,0"
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "PIKA is a free raster graphics editor used for image retouching and editing, free-form drawing, converting between different image formats, and more specialized tasks."
Root: HKA; Subkey: "Software\RegisteredApplications"; ValueType: string; ValueName: "PIKA {#MAJOR}.{#MINOR}"; ValueData: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities"; Flags: uninsdeletevalue
#define FileHandle
#define FileLine
#define Line=0
#sub ProcessAssociation
#if !defined(Finished)
#if Copy(FileLine,1,1)=="#" || FileLine==""
//skip comments and empty lines
#else
#pragma message "Processing associations.list: " + FileLine
;
Root: HKA; Subkey: "Software\Classes\.{#FileLine}\OpenWithProgids"; ValueType: string; ValueName: "PIKA2.{#FileLine}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\PIKA2.{#FileLine}"; ValueType: string; ValueName: ""; ValueData: "PIKA {#ICON_VERSION}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\PIKA2.{#FileLine}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\bin\pika-{#MAJOR}.{#MINOR}.exe,1"
Root: HKA; Subkey: "Software\Classes\PIKA2.{#FileLine}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\pika-{#MAJOR}.{#MINOR}.exe"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe\SupportedTypes"; ValueType: string; ValueName: ".{#FileLine}"; ValueData: ""
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities\FileAssociations"; ValueType: string; ValueName: ".{#FileLine}"; ValueData: "PIKA2.{#FileLine}"
#endif
#endif
#endsub
#for {FileHandle = FileOpen(AddBackslash(SourcePath)+"associations.list"); \
FileHandle && !FileEof(FileHandle); FileLine = FileRead(FileHandle)} \
ProcessAssociation
#if FileHandle
#expr FileClose(FileHandle)
#endif
;special case for .ico files
Root: HKA; Subkey: "Software\Classes\.ico\OpenWithProgids"; ValueType: string; ValueName: "PIKA2.ico"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\PIKA2.ico"; ValueType: string; ValueName: ""; ValueData: "PIKA {#ICON_VERSION}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\PIKA2.ico\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "%1"
Root: HKA; Subkey: "Software\Classes\PIKA2.ico\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\pika-{#MAJOR}.{#MINOR}.exe"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\pika-{#MAJOR}.{#MINOR}.exe\SupportedTypes"; ValueType: string; ValueName: ".ico"; ValueData: ""
Root: HKA; Subkey: "Software\PIKA {#MAJOR}.{#MINOR}\Capabilities\FileAssociations"; ValueType: string; ValueName: ".ico"; ValueData: "PIKA2.{#FileLine}"

View File

@ -0,0 +1,80 @@
xcf
ani
avif
bmp
dds
g3
cel
cur
dcm
dcx
dicom
exr
gif
heif
heic
icns
jp2
j2k
j2c
jpc
jxl
pcx
pcc
pdf
png
pnm
ppm
pgm
pbm
pfm
pam
ps
eps
psp
tub
pspimage
im1
im8
im24
im32
rs
ras
svg
tga
vda
icb
vst
tif
tiff
webp
wmf
apm
xpm
xwd
fit
fits
fli
flc
jpg
jpeg
jpe
psd
sgi
rgb
rgba
bw
icon
pix
matte
mask
alpha
als
xbm
ora
qoi
wbmp
acbm
iff
ilbm
lbm

View File

@ -0,0 +1,50 @@
@echo off
if [%1]==[] goto help
if [%2]==[] goto help
if [%3]==[] goto help
if [%4]==[] goto help
if [%5]==[] goto help
if [%6]==[] goto help
if [%7]==[] goto help
set VER=%~1
set PIKA_BASE=%~2
set PIKA32=%~3
set PIKA64=%~4
set DEPS_BASE=%~5
set DEPS32=%~6
set DEPS64=%~7
if [%INNOPATH%]==[] (
FOR /F "usebackq tokens=5,* skip=2" %%A IN (`REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1" /v "Inno Setup: App Path" /reg:32`) DO set INNOPATH=%%B
) else (if [%INNOPATH%]==[] (
FOR /F "usebackq tokens=5,* skip=2" %%A IN (`REG QUERY "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1" /v "Inno Setup: App Path" /reg:32`) DO set INNOPATH=%%B
))
if not exist "%INNOPATH%\iscc.exe" goto noinno
::i'd use %*, but shift has no effect on it
shift
shift
shift
shift
shift
shift
shift
set PARAMS=
:doparams
if "%1"=="" goto paramsdone
set PARAMS=%PARAMS% %1
shift
goto doparams
:paramsdone
"%INNOPATH%\iscc.exe" -DVERSION="%VER%" -DPIKA_DIR="%PIKA_BASE%" -DDIR32="%PIKA32%" -DDIR64="%PIKA64%" -DDEPS_DIR="%DEPS_BASE%" -DDDIR32="%DEPS32%" -DDDIR64="%DEPS64%" -DDEBUG_SYMBOLS -DPYTHON -DLUA %PARAMS% pika3264.iss
goto :eof
:help
echo Usage: %~n0%~x0 ver.si.on pika_base_dir pika_x86_dir pika_x64_dir deps_base_dir deps_x86_dir deps_x64_dir [iscc_parameters]
echo Example: %~n0%~x0 2.9.4 X:\pika-output\2.9-dev x86 x64 x:\pika-deps x86 x64 -DPYTHON -DDEBUG_SYMBOLS
goto :eof
:noinno
echo Inno Setup path could not be read from Registry - install Inno Setup or set INNOPATH environment variable pointing at it's
echo install directory
goto :eof

View File

@ -0,0 +1,36 @@
;allow specific configuration files to be overridden by files in a specific directory
#if 0
[Files]
#endif
#define FindHandle
#define FindResult
#sub ProcessConfigFile
#define FileName FindGetFileName(FindHandle)
Source: "{code:GetExternalConfDir}\{#FileName}"; DestDir: "{app}\{#ConfigDir}"; Flags: external restartreplace; Check: CheckExternalConf('{#FileName}')
#if BaseDir != PIKA_DIR32
Source: "{code:GetExternalConfDir}\{#FileName}"; DestDir: "{app}\32\{#ConfigDir}"; Components: pika32on64; Flags: external restartreplace; Check: CheckExternalConf('{#FileName}')
#endif
#endsub
#sub ProcessConfigDir
#emit ';; ' + ConfigDir
#emit ';; ' + BaseDir
#for {FindHandle = FindResult = FindFirst(AddBackslash(BaseDir) + AddBackSlash(ConfigDir) + "*", 0); \
FindResult; FindResult = FindNext(FindHandle)} ProcessConfigFile
#if FindHandle
#expr FindClose(FindHandle)
#endif
#endsub
#define public BaseDir PIKA_DIR32
#define public ConfigDir "etc\pika\2.0"
#expr ProcessConfigDir
#define public BaseDir DEPS_DIR32
#define public ConfigDir "etc\gtk-2.0"
#expr ProcessConfigDir
#define public ConfigDir "etc\fonts"
#expr ProcessConfigDir

View File

@ -0,0 +1,61 @@
//directories to source files from
#if !defined(VERSION)
#error "VERSION must be defined"
#endif
#define public
#if !defined(VER_DIR)
#if defined(REVISION)
#define VER_DIR VERSION + "-" + REVISION
#else
#define VER_DIR VERSION
#endif
#endif
#ifndef DIR32
#define DIR32 "i686-w64-mingw32"
#endif
#ifndef DIR64
#define DIR64 "x86_64-w64-mingw32"
#endif
#ifndef PIKA_DIR
#define PIKA_DIR "N:\pika\output\" + VER_DIR
#endif
#ifndef DEPS_DIR
#define DEPS_DIR "N:\pika\deps"
#endif
//32-bit PIKA base directory (result of make install)
#ifndef PIKA_DIR32
#define PIKA_DIR32 PIKA_DIR + "\" + DIR32
#endif
//64-bit PIKA base directory (result of make install)
#ifndef PIKA_DIR64
#define PIKA_DIR64 PIKA_DIR + "\" + DIR64
#endif
#ifndef DDIR32
#define DDIR32 DIR32
#endif
#ifndef DDIR64
#define DDIR64 DIR64
#endif
//32-bit dependencies directory
#ifndef DEPS_DIR32
#define DEPS_DIR32 DEPS_DIR + "\" + DDIR32
#endif
//64-bit dependencies directory
#ifndef DEPS_DIR64
#define DEPS_DIR64 DEPS_DIR + "\" + DDIR64
#endif
#ifdef PYTHON
//python source directory
#ifndef PY_DIR
#define PY_DIR "N:\common\python2.7"
#endif
#endif

View File

@ -0,0 +1,60 @@
#if 0
[Files]
#endif
#if PLATFORM==32
#define DIR DIR32
#define DDIR DDIR32
#elif PLATFORM==64
#define DIR DIR64
#define DDIR DDIR64
#else
#error "Unknown PLATFORM:" + PLATFORM
#endif
Source: "{#PIKA_DIR}\{#DIR}\*.dll"; DestDir: "{app}"; Components: pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#PIKA_DIR}\{#DIR}\*.exe"; DestDir: "{app}"; Excludes: "\lib\pika\{#DIR_VER}\plug-ins\twain\twain.exe,\lib\pika\{#DIR_VER}\plug-ins\file-ps\file-ps.exe,\bin\pika.exe,\bin\pika-console.exe"; Components: pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
#ifdef DEBUG_SYMBOLS
Source: "{#PIKA_DIR}\{#DIR}\*.debug"; DestDir: "{app}"; Components: pika{#PLATFORM} and debug; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
#endif
Source: "{#PIKA_DIR}\{#DIR}\lib\pika\{#DIR_VER}\extensions\*.*"; Excludes: "*.debug"; DestDir: "{app}\lib\pika\{#DIR_VER}\extensions"; Components: pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
#ifdef DEBUG_SYMBOLS
Source: "{#PIKA_DIR}\{#DIR}\lib\pika\{#DIR_VER}\extensions\*.debug"; DestDir: "{app}\lib\pika\{#DIR_VER}\extensions"; Components: pika{#PLATFORM} and debug; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
#endif
Source: "{#PIKA_DIR}\{#DIR}\lib\pika\{#DIR_VER}\plug-ins\file-ps\file-ps.exe"; DestDir: "{app}\lib\pika\{#DIR_VER}\plug-ins\file-ps"; Components: gs and pika{#PLATFORM}; Flags: restartreplace ignoreversion uninsrestartdelete
Source: "{#PIKA_DIR}\{#DIR}\lib\girepository-1.0\*.*"; DestDir: "{app}\lib\girepository-1.0"; Components: pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\girepository-1.0\*.*"; DestDir: "{app}\lib\girepository-1.0"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\bin\*.dll"; DestDir: "{app}\bin"; Excludes: "\bin\libgs*.dll,\bin\lua*.dll"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\bin\libgs*.dll"; DestDir: "{app}\bin"; Components: gs and deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
#ifdef DEBUG_SYMBOLS
Source: "{#DEPS_DIR}\{#DDIR}\bin\.debug\*.dll.debug"; DestDir: "{app}\bin\.debug"; Components: deps{#PLATFORM} and debug; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete skipifsourcedoesntexist
Source: "{#DEPS_DIR}\{#DDIR}\lib\*.debug"; DestDir: "{app}\lib"; Components: deps{#PLATFORM} and debug; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete skipifsourcedoesntexist
#endif
Source: "{#DEPS_DIR}\{#DDIR}\bin\gspawn-win*.exe"; DestDir: "{app}\bin"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\bin\gdk-pixbuf-query-loaders.exe"; DestDir: "{app}\bin"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\bin\bzip2.exe"; DestDir: "{app}\bin"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache"; DestDir: "{app}\lib\gdk-pixbuf-2.0\2.10.0\"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\babl-0.1\*.dll"; DestDir: "{app}\lib\babl-0.1"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\gdk-pixbuf-2.0\*.dll"; DestDir: "{app}\lib\gdk-pixbuf-2.0"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\gegl-0.4\*.dll"; DestDir: "{app}\lib\gegl-0.4"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\gio\*.dll"; DestDir: "{app}\lib\gio"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
;Source: "{#DEPS_DIR}\{#DDIR}\lib\gtk-3.0\*.dll"; DestDir: "{app}\lib\gtk-3.0"; Components: deps{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
;python scripts
#ifdef PYTHON
Source: "{#DEPS_DIR}\{#DDIR}\bin\python3w.exe"; DestDir: "{app}\bin"; DestName: "pythonw.exe"; Components: py and pika{#PLATFORM}; Flags: restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\bin\python3.exe"; DestDir: "{app}\bin"; DestName: "python.exe"; Components: py and pika{#PLATFORM}; Flags: restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\bin\libpython3.11.dll"; DestDir: "{app}\bin"; Components: py and pika{#PLATFORM}; Flags: restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\lib\python3.11\*"; DestDir: "{app}\lib\python3.11"; Components: py and pika{#PLATFORM}; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
#endif
#ifdef LUA
Source: "{#DEPS_DIR}\{#DDIR}\bin\luajit.exe"; DestDir: "{app}\bin"; Components: lua and pika{#PLATFORM}; Flags: restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\bin\lua51.dll"; DestDir: "{app}\bin"; Components: lua and pika{#PLATFORM}; Flags: restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR}\{#DDIR}\share\lua\*"; DestDir: "{app}\share\lua"; Components: lua and pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
Source: "{#DEPS_DIR}\{#DDIR}\lib\lua\*"; DestDir: "{app}\lib\lua"; Components: lua and pika{#PLATFORM}; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
#endif

View File

@ -0,0 +1,179 @@
{\rtf1\ansi\ansicpg1250\deff0\deflang1060\deflangfe1060{\fonttbl{\f0\fswiss\fprq2\fcharset238 Verdana;}{\f1\fmodern\fprq1\fcharset238 Lucida Console;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\keepn\nowidctlpar\sb100\sa200\qc\b\f0\fs28 GNU GENERAL PUBLIC LICENSE\par
\pard\nowidctlpar\sa60\qc\b0\fs16 Version 3, 29 June 2007\par
\pard\sa60 Copyright \'a9 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "http://fsf.org/"}}{\fldrslt{\ul\cf1 http://fsf.org/}}}\f0\fs16 >\par
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
\pard\keepn\nowidctlpar\sb100\sa100\qc\b\fs20 Preamble\par
\pard\nowidctlpar\sa60\b0\fs16 The GNU General Public License is a free, copyleft license for software and other kinds of works.\par
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par
The precise terms and conditions for copying, distribution and modification follow.\par
\pard\keepn\nowidctlpar\sb100\sa100\qc\b\fs20 TERMS AND CONDITIONS\par
\pard\keepn\nowidctlpar\sb100\sa100\fs16 0. Definitions.\par
\pard\nowidctlpar\sa60\b0\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par
\ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par
\ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and\ldblquote recipients\rdblquote may be individuals or organizations.\par
To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par
A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par
To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par
To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par
An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 1. Source Code.\par
\pard\nowidctlpar\sa60\b0 The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par
A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par
The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A\ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par
The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par
The Corresponding Source for a work in source code form is that same work.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 2. Basic Permissions.\par
\pard\nowidctlpar\sa60\b0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par
\pard\nowidctlpar\sa60\b0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 4. Conveying Verbatim Copies.\par
\pard\nowidctlpar\sa60\b0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 5. Conveying Modified Source Versions.\par
\pard\nowidctlpar\sa60\b0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par
\pard\nowidctlpar\fi-360\li720\sa60 a)\tab The work must carry prominent notices stating that you modified it, and giving a relevant date. \par
b)\tab The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote . \par
c)\tab You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. \par
d)\tab If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par
\pard\nowidctlpar\sa60 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an\ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 6. Conveying Non-Source Forms.\par
\pard\nowidctlpar\sa60\b0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par
\pard\nowidctlpar\fi-360\li720\sa60 a)\tab Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. \par
b)\tab Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. \par
c)\tab Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. \par
d)\tab Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. \par
e)\tab Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par
\pard\nowidctlpar\sa60 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par
A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par
\ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 7. Additional Terms.\par
\pard\nowidctlpar\sa60\b0\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par
\pard\nowidctlpar\fi-360\li720\sa60 a)\tab Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or \par
b)\tab Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or \par
c)\tab Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or \par
d)\tab Limiting the use for publicity purposes of names of licensors or authors of the material; or \par
e)\tab Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or \par
f)\tab Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. \par
\pard\nowidctlpar\sa60 All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 8. Termination.\par
\pard\nowidctlpar\sa60\b0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 9. Acceptance Not Required for Having Copies.\par
\pard\nowidctlpar\sa60\b0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 10. Automatic Licensing of Downstream Recipients.\par
\pard\nowidctlpar\sa60\b0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par
An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 11. Patents.\par
\pard\nowidctlpar\sa60\b0 A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \ldblquote contributor version\rdblquote .\par
A contributor's \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par
In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par
A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 12. No Surrender of Others' Freedom.\par
\pard\nowidctlpar\sa60\b0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 13. Use with the GNU Affero General Public License.\par
\pard\nowidctlpar\sa60\b0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 14. Revised Versions of this License.\par
\pard\nowidctlpar\sa60\b0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 15. Disclaimer of Warranty.\par
\pard\nowidctlpar\sa60\b0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 16. Limitation of Liability.\par
\pard\nowidctlpar\sa60\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par
\pard\keepn\nowidctlpar\sb100\sa100\b 17. Interpretation of Sections 15 and 16.\par
\pard\nowidctlpar\sa120\b0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par
\pard\nowidctlpar\sb120\sa120\qc END OF TERMS AND CONDITIONS\par
\pard\keepn\nowidctlpar\sb100\sa100\qc\b\fs20 How to Apply These Terms to Your New Programs\fs16\par
\pard\nowidctlpar\sa60\b0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \ldblquote copyright\rdblquote line and a pointer to where the full notice is found.\par
\pard\nowidctlpar\li454\sb120\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631\f1 <one line to give the program's name and a brief idea of what it does.>\par
\pard\nowidctlpar\li454\sl480\slmult1\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 Copyright (C) <year> <name of author>\par
\pard\nowidctlpar\li454\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 This program is free software: you can redistribute it and/or modify\par
it under the terms of the GNU General Public License as published by\par
the Free Software Foundation, either version 3 of the License, or\par
\pard\nowidctlpar\li454\sl480\slmult1\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 (at your option) any later version.\par
\pard\nowidctlpar\li454\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 This program is distributed in the hope that it will be useful,\par
but WITHOUT ANY WARRANTY; without even the implied warranty of\par
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\par
\pard\nowidctlpar\li454\sl480\slmult1\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 GNU General Public License for more details.\par
\pard\nowidctlpar\li454\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 You should have received a copy of the GNU General Public License\par
\pard\li454\sa120\sl240\slmult1 along with this program. If not, see <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/"}}{\fldrslt{\ul\cf1 https://www.gnu.org/licenses/}}}\f1\fs16 >.\par
\pard\nowidctlpar\sa60\f0 Also add information on how to contact you by electronic and paper mail.\par
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\par
\pard\nowidctlpar\li454\sb120\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631\f1 <program> Copyright (C) <year> <name of author>\par
\pard\nowidctlpar\li454\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\par
This is free software, and you are welcome to redistribute it\par
\pard\nowidctlpar\li454\sa120\tx0\tx959\tx1918\tx2877\tx3836\tx4795\tx5754\tx6713\tx7672\tx8631 under certain conditions; type `show c' for details.\par
\pard\nowidctlpar\sa60\f0 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an \ldblquote about box\rdblquote .\par
\pard You should also get your employer (if you work as a programmer) or school, if any, to sign a \ldblquote copyright disclaimer\rdblquote for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/"}}{\fldrslt{\ul\cf1 https://www.gnu.org/licenses/}}}\f0\fs16 >.\par
\pard\sa200\sl240\slmult1 The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/philosophy/why-not-lgpl.html"}}{\fldrslt{\ul\cf1 http://www.gnu.org/philosophy/why-not-lgpl.html}}}\f0\fs16 >.\par
\pard\nowidctlpar\qj\f1\fs12 PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2\par
\pard\nowidctlpar\sa120\qj --------------------------------------------\par
\pard\nowidctlpar\qj 1. This LICENSE AGREEMENT is between the Python Software Foundation\par
("PSF"), and the Individual or Organization ("Licensee") accessing and\par
otherwise using this software ("Python") in source or binary form and\par
\pard\nowidctlpar\sa120\qj its associated documentation.\par
\pard\nowidctlpar\qj 2. Subject to the terms and conditions of this License Agreement, PSF\par
hereby grants Licensee a nonexclusive, royalty-free, world-wide\par
license to reproduce, analyze, test, perform and/or display publicly,\par
prepare derivative works, distribute, and otherwise use Python\par
alone or in any derivative version, provided, however, that PSF's\par
License Agreement and PSF's notice of copyright, i.e., "Copyright (c)\par
2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights\par
Reserved" are retained in Python alone or in any derivative version \par
\pard\nowidctlpar\sa120\qj prepared by Licensee.\par
\pard\nowidctlpar\qj 3. In the event Licensee prepares a derivative work that is based on\par
or incorporates Python or any part thereof, and wants to make\par
the derivative work available to others as provided herein, then\par
Licensee hereby agrees to include in any such work a brief summary of\par
\pard\nowidctlpar\sa120\qj the changes made to Python.\par
\pard\nowidctlpar\qj 4. PSF is making Python available to Licensee on an "AS IS"\par
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR\par
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND\par
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS\par
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT\par
\pard\nowidctlpar\sa120\qj INFRINGE ANY THIRD PARTY RIGHTS.\par
\pard\nowidctlpar\qj 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\par
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS\par
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,\par
\pard\nowidctlpar\sa120\qj OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\par
\pard\nowidctlpar\qj 6. This License Agreement will automatically terminate upon a material\par
\pard\nowidctlpar\sa120\qj breach of its terms and conditions.\par
\pard\nowidctlpar\qj 7. Nothing in this License Agreement shall be deemed to create any\par
relationship of agency, partnership, or joint venture between PSF and\par
Licensee. This License Agreement does not grant permission to use PSF\par
trademarks or trade name in a trademark sense to endorse or promote\par
\pard\nowidctlpar\sa120\qj products or services of Licensee, or any third party.\par
\pard\nowidctlpar\qj 8. By copying, installing or otherwise using Python, Licensee\par
agrees to be bound by the terms and conditions of this License\par
Agreement.\fs15\par
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

View File

@ -0,0 +1,3 @@
#!/bin/bash
sed "1s/^/\xEF\xBB\xBF/" "$1" > "$2"

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="2.0"
xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0">
<its:translateRule selector="/pika-ms-installer-config" translate="no"/>
<its:translateRule selector="//value" translate="yes"/>
<gt:escapeRule selector="//value" escape="no"/>
</its:rules>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="PikaMsInstallerConfig" pattern="*.xml">
<documentRule localName="pika-ms-installer-config" target="pika-ms-installer-config.its"/>
</locatingRule>
</locatingRules>

View File

@ -0,0 +1,132 @@
# First we use the XML file to be able to do gettext translation
ms_installer_config_xml = i18n.merge_file(
input : 'setup.isl.xml.in',
output: '@BASENAME@',
data_dirs: meson.current_source_dir(),
po_dir: po_windows_installer_dir,
install: false,
)
languages = [
{ 'code': 'bg', },
{ 'code': 'ca', },
{ 'code': 'cs', },
{ 'code': 'da', },
{ 'code': 'de', },
{ 'code': 'el', },
{ 'code': 'en', 'default': true, },
{ 'code': 'en_GB', },
{ 'code': 'eo', },
{ 'code': 'es', },
{ 'code': 'eu', },
{ 'code': 'fi', },
{ 'code': 'fr', },
{ 'code': 'gl', },
{ 'code': 'he', },
{ 'code': 'hu', },
{ 'code': 'id', },
{ 'code': 'is', },
{ 'code': 'it', },
{ 'code': 'ja', },
{ 'code': 'ka', },
{ 'code': 'kab', 'langname': 'Taqbaylit' },
{ 'code': 'ko', },
{ 'code': 'lt', },
{ 'code': 'lv', },
{ 'code': 'mr', },
{ 'code': 'ms', },
{ 'code': 'nl', },
{ 'code': 'pl', },
{ 'code': 'pt', },
{ 'code': 'pt_BR', },
{ 'code': 'ro', },
{ 'code': 'ru', },
{ 'code': 'sk', },
{ 'code': 'sl', },
{ 'code': 'sv', },
{ 'code': 'tr', },
{ 'code': 'uk', },
{ 'code': 'vi', },
{ 'code': 'zh_CN', },
{ 'code': 'zh_TW', },
]
addbom = find_program(meson.current_source_dir() / 'addbom.sh')
# Then, we generate the .isl file for each language using some xsltproc magic
foreach language : languages
lang_code = language.get('code')
if 'default' in language
lang_check = 'value[not(@xml:lang)]'
else
lang_check = 'value[lang(\'@0@\')]'.format(lang_code)
endif
pika_ms_installer_lang_xsl = configure_file(
input: 'pika-ms-installer-config.xsl.in',
output: 'pika-ms-installer-config-@0@.xsl'.format(lang_code),
configuration: { 'LANG_CHECK': lang_check },
)
nobom_setup_isl = '@0@-nobom.setup.isl'.format(lang_code)
nobom_setup_isl_tmp = custom_target(nobom_setup_isl,
input : [ ms_installer_config_xml, pika_ms_installer_lang_xsl ],
output: nobom_setup_isl,
command: [
xsltproc,
'--xinclude',
'--output', '@OUTPUT@',
'@INPUT1@',
'@INPUT0@',
],
build_by_default: true,
)
setup_isl = '@0@.setup.isl'.format(lang_code)
# Inno-Setup absolutely requires a BOM to recognize UTF-8 files.
# Here I am working around 3 issues in meson:
# 1. We can't easily combine commands in meson. So either we combine
# them in an external script, or we run several custom_target(). I do
# a mix of both because custom_target() has too many bugs.
# 2. To concat a BOM to the file, I'd like to simply call this Python
# code:
# 'open("@OUTPUT@", "wb").write(b"\\xEF\\xBB\\xBF" + open("@INPUT@", "rb").read())'
# Unfortunately we can't pass several @INPUT@/@OUTPUT@ in a same arg.
# See: https://github.com/mesonbuild/meson/issues/7696
# 3. Antislashes are replaced with slashes in custom_target(). I tried
# some weird trick encoding a string to UTF-8 instead of using the
# well known BOM bytes directly. Unfortunately result was not
# consistent on all platforms (at least Linux and Windows).
# See https://github.com/mesonbuild/meson/issues/1564
custom_target(setup_isl,
input : [ nobom_setup_isl_tmp, 'addbom.sh' ],
output: [ setup_isl ],
command: [
addbom, '@INPUT0@', '@OUTPUT@'
],
build_by_default: true,
)
if 'langname' in language
# Some languages may have no default language file provided by
# InnoSetup. When this happens, we must at least complete a very
# basic file showing the language name, otherwise it shows as
# "English".
newlang_isl = '@0@.isl'.format(language.get('code'))
newlang_conf = configuration_data()
newlang_conf.set('LANGNAME', language.get('langname'))
configure_file(
input : 'newlang.isl.in',
output : newlang_isl,
configuration : newlang_conf
)
endif
endforeach
test('windows-installer-langs',
find_program('test-installer-langs.sh'),
env: [
'PIKA_TESTING_ABS_TOP_SRCDIR=' + meson.project_source_root(),
],
suite: 'build')

View File

@ -0,0 +1,15 @@
; A template to create the basic lang file for languages which are not
; made available by InnoSetup, not even in the Unofficial/ folder.
; See full list of languages:
; https://github.com/jrsoftware/issrc/tree/main/Files/Languages
;
; Without this, they show as English in the
; start list so we must add a language name (localized preferably) at
; the very least.
; See also the docs for the meanings of different fields:
; https://jrsoftware.org/ishelp/index.php?topic=langoptionssection
[LangOptions]
LanguageName=@LANGNAME@
LanguageID=$0
LanguageCodePage=0

View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:apply-templates select="pika-ms-installer-config" />
</xsl:template>
<xsl:template match="pika-ms-installer-config">
<xsl:apply-templates select="section" />
</xsl:template>
<xsl:template match="section">[<xsl:value-of select="@name"/>]
<xsl:apply-templates select="config" />
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="config">
<xsl:value-of select="@name"/>=<xsl:value-of select="."/>
<xsl:apply-templates select="@LANG_CHECK@" />
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="config">
<xsl:choose>
<xsl:when test="@LANG_CHECK@">
<xsl:value-of select="@name"/>=<xsl:apply-templates select="@LANG_CHECK@" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>=<xsl:apply-templates select="value[not(@xml:lang)]" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,326 @@
<?xml version='1.0' encoding='UTF-8'?>
<pika-ms-installer-config>
<section name="Messages">
<!-- InfoBefore page is used instead of license page because the GPL only concerns distribution, not use, and as such doesn't have to be accepted -->
<config name="WizardInfoBefore">
<value>License Agreement</value>
</config>
<config name="AboutSetupNote">
<value>Setup built by Jernej Simonèiè, jernej-pika@ena.si</value>
</config>
<config name="WinVersionTooLowError">
<value>This version of PIKA requires Windows 7, or a newer version of Windows.</value>
</config>
<config name="WindowsVersionNotSupported">
<value>This version of PIKA requires Windows 7, or a newer version of Windows.</value>
</config>
</section>
<section name="CustomMessages">
<!-- Shown before the wizard starts on development versions of PIKA -->
<config name="DevelopmentWarningTitle">
<value>Development version</value>
</config>
<!-- Shown before the wizard starts on development versions of PIKA -->
<config name="DevelopmentWarning">
<value>This is a development version of PIKA where some features may not be finished, or it may be unstable.%nThis version of PIKA is not intended for day-to-day work as it may be unstable, and you could lose your work.%nIf you encounter any problems, first verify that they haven't already been fixed in GIT before you contact the developers or report it in PIKA gitlab:%n_https://gitlab.gnome.org/GNOME/pika/issues%n%nDo you wish to continue with installation anyway?</value>
</config>
<config name="DevelopmentButtonContinue">
<value>&amp;Continue</value>
</config>
<config name="DevelopmentButtonExit">
<value>Exit</value>
</config>
<!--
<config name="XPSP3Recommended">
<value>Warning: you are running an unsupported version of Windows. Please update to at least Windows XP with Service Pack 3 before reporting any problems.</value>
</config>
-->
<config name="SSERequired">
<value>This version of PIKA requires a processor that supports SSE instructions.</value>
</config>
<config name="Require32BPPTitle">
<value>Display settings problem</value>
</config>
<config name="Require32BPP">
<value>Setup has detected that your Windows is not running in 32 bits-per-pixel display mode. This has been known to cause stability problems with PIKA, so it's recommended to change the display colour depth to 32BPP before continuing.</value>
</config>
<config name="Require32BPPContinue">
<value>&amp;Continue</value>
</config>
<config name="Require32BPPExit">
<value>E&amp;xit</value>
</config>
<config name="InstallOrCustomize">
<value>PIKA is now ready to be installed. Click the Install now button to install using the default settings, or click the Customize button if you'd like to have more control over what gets installed.</value>
</config>
<config name="Install">
<value>&amp;Install</value>
</config>
<config name="Customize">
<value>&amp;Customize</value>
</config>
<!-- Setup types -->
<config name="TypeCompact">
<value>Compact installation</value>
</config>
<!-- Setup types -->
<config name="TypeCustom">
<value>Custom installation</value>
</config>
<!-- Setup types -->
<config name="TypeFull">
<value>Full installation</value>
</config>
<!-- Text above component description -->
<config name="ComponentsDescription">
<value>Description</value>
</config>
<!-- Components -->
<config name="ComponentsPika">
<value>PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsPikaDescription">
<value>PIKA and all default plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsDeps">
<value>Run-time libraries</value>
</config>
<!-- Components -->
<config name="ComponentsDepsDescription">
<value>Run-time libraries used by PIKA, including GTK Run-time Environment</value>
</config>
<!-- Components -->
<config name="ComponentsDebug">
<value>Debug symbols</value>
</config>
<!-- Components -->
<config name="ComponentsDebugDescription">
<value>Include information to help with debugging PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsGtkWimp">
<value>MS-Windows engine for GTK</value>
</config>
<!-- Components -->
<config name="ComponentsGtkWimpDescription">
<value>Native Windows look for PIKA</value>
</config>
<!-- Components -->
<config name="ComponentsCompat">
<value>Support for old plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsCompatDescription">
<value>Install libraries needed by old third-party plug-ins</value>
</config>
<!-- Components -->
<config name="ComponentsTranslations">
<value>Translations</value>
</config>
<!-- Components -->
<config name="ComponentsTranslationsDescription">
<value>Translations</value>
</config>
<!-- Components -->
<config name="ComponentsPython">
<value>Python scripting</value>
</config>
<!-- Components -->
<config name="ComponentsPythonDescription">
<value>Allows you to use PIKA plugins written in Python scripting language.</value>
</config>
<!-- Components -->
<config name="ComponentsLua">
<value>Lua scripting</value>
</config>
<!-- Components -->
<config name="ComponentsLuaDescription">
<value>Allows you to use PIKA plugins written in Lua scripting language.</value>
</config>
<!-- Components -->
<config name="ComponentsMyPaint">
<value>MyPaint brushes</value>
</config>
<!-- Components -->
<config name="ComponentsMyPaintDescription">
<value>Install the default set of MyPaint brushes</value>
</config>
<!-- Components -->
<config name="ComponentsGhostscript">
<value>PostScript support</value>
</config>
<!-- Components -->
<config name="ComponentsGhostscriptDescription">
<value>Allow PIKA to load PostScript files</value>
</config>
<!-- Components, only when installing on x64 Windows -->
<config name="ComponentsPika32">
<value>Support for 32-bit plug-ins</value>
</config>
<!-- Compoments, only when installing on x64 Windows -->
<config name="ComponentsPika32Description">
<value>Include files necessary for using 32-bit plug-ins.%nRequired for Python support.</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIcons">
<value>Additional icons:</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIconsDesktop">
<value>Create a &amp;desktop icon</value>
</config>
<!-- Additional installation tasks -->
<config name="AdditionalIconsQuickLaunch">
<value>Create a &amp;Quick Launch icon</value>
</config>
<config name="RemoveOldPIKA">
<value>Remove previous PIKA version</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorChangingEnviron">
<value>There was a problem updating PIKA's environment in %1. If you get any errors loading the plug-ins, try uninstalling and re-installing PIKA.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorExtractingTemp">
<value>Error extracting temporary data.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingPython">
<value>Error updating Python interpreter info.</value>
</config>
<!-- This message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingMyPaint">
<value>Error updating MyPaint brushes info.</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorReadingPikaRC">
<value>There was an error updating %1.</value>
</config>
<!-- %1 is replaced by file name; this message should never appear (unless user runs out of disk space at the exact right moment) -->
<config name="ErrorUpdatingPikaRC">
<value>There was an error updating PIKA's configuration file %1.</value>
</config>
<!-- Displayed in Explorer's right-click menu -->
<config name="OpenWithPika">
<value>Edit with PIKA</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsCaption">
<value>Select file associations</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsExtensions">
<value>Extensions:</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsInfo1">
<value>Select the file types you wish to associate with PIKA</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsInfo2">
<value>This will make selected files open in PIKA when you double-click them in Explorer.</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsSelectAll">
<value>Select &amp;All</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsUnselectAll">
<value>Unselect &amp;All</value>
</config>
<!-- File associations page -->
<config name="SelectAssociationsSelectUnused">
<value>Select &amp;Unused</value>
</config>
<!-- Shown on summary screen just before starting the install -->
<config name="ReadyMemoAssociations">
<value>File types to associate with PIKA:</value>
</config>
<config name="RemovingOldVersion">
<value>Removing previous version of PIKA:</value>
</config>
<!-- %1 = version, %2 = installation directory; ran uninstaller, but it returned an error, or didn't remove everything -->
<config name="RemovingOldVersionFailed">
<value>PIKA %1 cannot be installed over your currently installed PIKA version, and the automatic uninstall of old version has failed.%n%nPlease remove the previous version of PIKA yourself before installing this version in %2, or choose a Custom install, and select a different installation folder.%n%nThe Setup will now exit.</value>
</config>
<!-- %1 = version, %2 = installation directory; couldn't find an uninstaller, or found several uninstallers -->
<config name="RemovingOldVersionCantUninstall">
<value>PIKA %1 cannot be installed over your currently installed PIKA version, and Setup couldn't determine how to remove the old version automatically.%n%nPlease remove the previous version of PIKA and any add-ons yourself before installing this version in %2, or choose a Custom install, and select a different installation folder.%n%nThe Setup will now exit.</value>
</config>
<config name="RebootRequiredFirst">
<value>Previous PIKA version was removed successfully, but Windows has to be restarted before the Setup can continue.%n%nAfter restarting your computer, Setup will continue next time an administrator logs in.</value>
</config>
<!-- Displayed if restart settings couldn't be read, or if the setup couldn't re-run itself -->
<config name="ErrorRestartingSetup">
<value>There was an error restarting the Setup. (%1)</value>
</config>
<config name="RemovingOldFiles">
<value>Cleaning up old files...</value>
</config>
<!-- Displayed while the files are being extracted; note the capitalisation! -->
<config name="Billboard1">
<value>Remember: PIKA is Free Software.%n%nPlease visit</value>
</config>
<!-- https://heckin.technology/AlderconeStudio/PIKApp (displayed between Billboard1 and Billboard2) -->
<config name="Billboard2">
<value>for free updates.</value>
</config>
<config name="SettingUpAssociations">
<value>Setting up file associations...</value>
</config>
<config name="SettingUpPyPika">
<value>Setting up environment for PIKA Python extension...</value>
</config>
<config name="SettingUpMyPaint">
<value>Setting up MyPaint brushes...</value>
</config>
<config name="SettingUpEnvironment">
<value>Setting up PIKA environment...</value>
</config>
<config name="SettingUpPikaRC">
<value>Setting up PIKA configuration for 32-bit plug-in support...</value>
</config>
<!-- Displayed on last page -->
<config name="LaunchPika">
<value>Launch PIKA</value>
</config>
<!-- Shown during uninstall when removing add-ons -->
<config name="UninstallingAddOnCaption">
<value>Removing add-on</value>
</config>
<config name="InternalError">
<value>Internal error (%1).</value>
</config>
<!-- Used by installer for add-ons (currently only help) -->
<config name="DirNotPika">
<value>PIKA does not appear to be installed in the selected directory. Continue anyway?</value>
</config>
</section>
</pika-ms-installer-config>

View File

@ -0,0 +1,55 @@
#!/bin/sh
# Make sure that the languages specified in the installer match the
# translations present. This check step is necessary to not forget new
# installer translations because we have a manual step.
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/pika3264.iss | \
sed 's/^Name: *"\([a-zA-Z_]*\)".*$/\1/' | sort`
# 'en' doesn't have a gettext file because it is the default.
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
PO_LANGS=`ls ${PIKA_TESTING_ABS_TOP_SRCDIR}/po-windows-installer/*.po | \
sed 's%.*/po-windows-installer/\([a-zA-Z_]*\).po%\1%' | sort`
PO_LANGS=`echo "$PO_LANGS" | tr '\n\r' ' '`
if [ "$PO_LANGS" != "$INSTALLER_LANGS" ]; then
echo "Error: languages listed in the Windows installer script do not match the .po files in po-windows-installer/."
echo "- PO languages: $PO_LANGS"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/installer/pika3264.iss"
echo "Base language files can be found in: https://github.com/jrsoftware/issrc/tree/main/Files/Languages"
echo "If a new language is in Unofficial/, also edit/download it from:"
echo "build/windows/gitlab-ci/installer-pika-msys2.sh"
exit 1
fi
MESON_LANGS=`grep "'code':" ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/lang/meson.build | \
sed "s/^.*'code': *'\([^']*\)'.*$/\1/" |sort`
MESON_LANGS=`echo "$MESON_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
if [ "$PO_LANGS" != "$MESON_LANGS" ]; then
echo "Error: languages listed in the meson script do not match the .po files in po-windows-installer/."
echo "- PO languages: $PO_LANGS"
echo "- Meson languages: $MESON_LANGS"
echo "Please verify: build/windows/installer/lang/meson.build"
exit 1
fi
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile.*Unofficial' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/pika3264.iss | \
sed 's/^.*Unofficial\\\\\([a-zA-Z_.]*\),.*$/\1/' | sort`
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' '`
PULLED_UNOFFICIAL=`grep '^download_lang [^(]' ${PIKA_TESTING_ABS_TOP_SRCDIR}/build/windows/gitlab-ci/installer-pika-msys2.sh | \
sed 's$^download_lang \([^.]*.isl.\?\)$\1$' | sort`
PULLED_UNOFFICIAL=`echo "$PULLED_UNOFFICIAL" | tr '\n\r' ' '`
if [ "$INSTALLER_LANGS" = "$PULLED_UNOFFICIAL" ]; then
exit 0
else
echo "Error: unofficial languages listed in the Windows installer script do not match the pulled InnoSetup files."
echo "- Pulled files: $PULLED_UNOFFICIAL"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/gitlab-ci/installer-pika-msys2.sh"
exit 1
fi

View File

@ -0,0 +1,41 @@
subdir('lang')
source_splash=meson.project_source_root() + '/data/images/pika-splash.png'
# make PIKA runnable without being installed.
env=environment()
menu_paths=meson.project_build_root() / 'menus:' + meson.project_source_root() / 'menus'
env.set('PIKA_TESTING_MENUS_PATH', menu_paths)
env.set('PIKA_TESTING_PLUGINDIRS', meson.project_build_root() / 'plug-ins:')
env.append('PIKA_TESTING_PLUGINDIRS', meson.project_build_root() / 'plug-ins/python')
env.append('PIKA_TESTING_PLUGINDIRS', meson.project_build_root() / 'plug-ins/common/test-plug-ins/')
env.prepend('GI_TYPELIB_PATH', meson.project_build_root() / 'libpika')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpika')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikabase')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikacolor')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikaconfig')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikamath')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikamodule')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikathumb')
env.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libpikawidgets')
if enable_console_bin
pika_exe=pikaconsole_exe
else
pika_exe=pikamain_exe
endif
installsplash = custom_target('installsplash-devel.bmp',
input : [ 'splash2installer.py' ],
depend_files: [ source_splash ],
output: [ 'installsplash-devel.bmp', ],
command: [ pika_exe, '-nidfs', source_splash,
'--batch-interpreter', 'python-fu-eval',
'-b', '-', '--quit'],
feed: true,
build_by_default: true,
env: env
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,130 @@
#if 0
[Code]
#endif
function Quote(const S: String): String;
begin
Result := '"' + S + '"';
end;
function AddParam(const S, P, V: String): String;
begin
if V <> '""' then
Result := S + ' /' + P + '=' + V;
end;
function AddSimpleParam(const S, P: String): String;
begin
Result := S + ' /' + P;
end;
procedure CreateRunOnceEntry;
var RunOnceData, SetupRestartData: String;
i: Integer;
begin
DebugMsg('CreateRunOnceEntry','Preparing for restart');
//RunOnce command-line is limited to 256 characters, so keep it to the bare minimum required to start setup
RunOnceData := Quote(ExpandConstant('{srcexe}')) + ' /resumeinstall=1';
RunOnceData := AddParam(RunOnceData, 'LANG', ExpandConstant('{language}'));
SetupRestartData := Quote(ExpandConstant('{srcexe}')) + ' /resumeinstall=2';
SetupRestartData := AddParam(SetupRestartData, 'LANG', ExpandConstant('{language}'));
SetupRestartData := AddParam(SetupRestartData, 'DIR', Quote(WizardDirValue));
//SetupRestartData := AddParam(SetupRestartData, 'GROUP', Quote(WizardGroupValue));
//if WizardNoIcons then
// SetupRestartData := AddSimpleParam(SetupRestartData, 'NOICONS');
SetupRestartData := AddParam(SetupRestartData, 'TYPE', Quote(WizardSetupType(False)));
SetupRestartData := AddParam(SetupRestartData, 'COMPONENTS', Quote(WizardSelectedComponents(False)));
SetupRestartData := AddParam(SetupRestartData, 'TASKS', Quote(WizardSelectedTasks(False)));
if Force32bitInstall then
SetupRestartData := AddSimpleParam(SetupRestartData, '32');
if ExpandConstant('{param:log|*}') <> '*' then
begin
SetupRestartData := AddParam(SetupRestartData, 'LOG', Quote(ExpandConstant('{param:log|*}')));
end else
begin
for i := 0 to ParamCount() do
if LowerCase(ParamStr(i)) = '/log' then
begin
RunOnceData := AddSimpleParam(RunOnceData,'LOG'); //multiple logs are created in %TEMP% when no filename is given
SetupRestartData := AddSimpleParam(SetupRestartData,'LOG');
break;
end;
end;
DebugMsg('CreateRunOnceEntry','RunOnce: ' + RunOnceData);
RegWriteStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\RunOnce', RunOnceName, RunOnceData);
DebugMsg('CreateRunOnceEntry','RunOnce: ' + SetupRestartData);
RegWriteStringValue(HKLM, 'Software\' + RunOnceName, '', SetupRestartData);
end;
procedure RestartMyself();
var CmdLine: String;
ResultCode: Integer;
begin
DebugMsg('RestartMyself','Continuing install after reboot (reexecuting setup)');
if RegValueExists(HKLM, 'Software\' + RunOnceName, '') then
begin
if RegQueryStringValue(HKLM, 'Software\' + RunOnceName, '', CmdLine) then
begin
RegDeleteKeyIncludingSubkeys(HKLM, 'Software\' + RunOnceName); //clean up
if not Exec('>',CmdLine,'',SW_SHOW,ewNoWait,ResultCode) then //bonus: don't block shell from loading, since RunOnce installer exits immediately
MsgBox(FmtMessage(CustomMessage('ErrorRestartingSetup'),[IntToStr(ResultCode)]), mbError, mb_Ok);
DebugMsg('RestartMyself','Result of running ' + CmdLine + ': ' + IntToStr(ResultCode));
end else
begin
MsgBox(FmtMessage(CustomMessage('ErrorRestartingSetup'),['-2']), mbError, mb_Ok);
DebugMsg('RestartMyself','Error reading HKLM\'+RunOnceName);
end;
end else
begin
MsgBox(FmtMessage(CustomMessage('ErrorRestartingSetup'),['-1']), mbError, mb_Ok);
DebugMsg('RestartMyself','HKLM\'+RunOnceName + ' not found in Registy');
end;
end;
function RestartSetupAfterReboot(): Boolean;
begin
if ExpandConstant('{param:resumeinstall|0}') = '1' then //called from RunOnce
begin
Result := False; //setup will just re-execute itself in this run
RestartMyself();
DebugMsg('RestartSetupAfterReboot','Phase 1 complete, exiting');
exit;
end else
if ExpandConstant('{param:resumeinstall|0}') = '2' then //setup re-executed itself
begin
Result := True;
InstallMode := imRebootContinue;
DebugMsg('RestartSetupAfterReboot','Continuing install after reboot');
end else
begin
Result := True; //normal install
end;
if InstallMode <> imRebootContinue then
if RegValueExists(HKLM, 'Software\Microsoft\Windows\CurrentVersion\RunOnce', RunOnceName) then
begin
DebugMsg('RestartSetupAfterReboot','System must be restarted first');
MsgBox(CustomMessage('RebootRequiredFirst'), mbError, mb_Ok);
Result := False;
end;
end;

View File

@ -0,0 +1,29 @@
[File Associations]
1=PIKA image:XCF
2=Adobe Photoshop(tm) image:PSD
3=Alias|Wavefront PowerAnimator:matte:mask:alpha:als:PIX
4=Compuserve GIF:GIF
5=Corel PaintShopPro image:PSP:PSPIMAGE:TUB
6=Digital Imaging and Communications in Medicine:DICOM:DCM
7=Fax G3 Image file:g3
8=Flexible Image Transport System:fit:fits
9=PIKA brush pipe:gih
10=PIKA brush:gbr:gpb
11=PIKA pattern:pat
12=JPEG image:JPEG:JPG
13=KISS CEL:CEL
14=Netpbm format:pnm:ppm:pgm:pbm
15=Portable Network Graphics:PNG
16=PostScript, Encapsulated PostScript:PS:EPS
17=Scalable Vector Graphics:svg
18=SGI image format:SGI:RGB:BW:ICON
19=SUN Raster Image:ras:im1:im8:im24:im32
20=Tagged Image File:tif:tiff
21=TrueVision Targa:tga
22=Windows and OS/2 Bitmaps:BMP
23=Windows Icon:ICO
24=Windows Metafile:wmf
25=X10 and X11 Bitmap:xbm:icon:bitmap
26=X Pixmap:xpm
27=X Window Dump:xwd
28=ZSoft Paintbrush image:PCX

View File

@ -0,0 +1,38 @@
image = Pika.list_images()[0]
config = Pika.get_pdb().lookup_procedure("file-bmp-save").create_config()
def export_scaled_img(image, target_width, target_height, export_path):
img = image.duplicate()
w = img.get_width()
h = img.get_height()
new_width = target_width
new_height = target_height
offx = 0
offy = 0
if w / target_width * target_height < h:
new_width = target_height / h * w
offx = (target_width - new_width) / 2
else:
new_height = target_width / w * h
offy = (target_height - new_height) / 2
img.scale(new_width, new_height)
img.resize(target_width, target_height, offx, offy)
# XXX: should we rather use the average color as border?
black = Pika.RGB()
black.set(0, 0, 0)
Pika.context_set_background(black)
drawables = img.list_selected_drawables()
for d in drawables:
d.resize_to_image_size()
config.set_property("image", img)
config.set_property("num-drawables", len(drawables))
config.set_property("drawables", Pika.ObjectArray.new(Pika.Drawable, drawables, False))
config.set_property("file", Gio.file_new_for_path(export_path))
Pika.get_pdb().run_procedure_config("file-bmp-save", config)
# These sizes are pretty much hardcoded, and in particular the ratio matters in
# InnoSetup. Or so am I told. XXX
export_scaled_img(image, 994, 692, 'build/windows/installer/installsplash-devel.bmp')
export_scaled_img(image, 497, 360, 'build/windows/installer/installsplash_small-devel.bmp')
export_scaled_img(image, 1160, 803, 'build/windows/installer/installsplash_big-devel.bmp')

View File

@ -0,0 +1,335 @@
#if 0
[Code]
#endif
function SplitRegParams(const pInf: String; var oRootKey: Integer; var oKey,oValue: String): Boolean;
var sRootKey: String;
d: Integer;
begin
Result := False;
d := Pos('/',pInf);
if d = 0 then
begin
DebugMsg('SplitRegParams','Malformed line (missing /): ' + pInf);
exit;
end;
sRootKey := Copy(pInf,1,d - 1);
oKey := Copy(pInf,d + 1,Length(pInf));
if oValue <> 'nil' then
begin
d := RevPos('\',oKey);
if d = 0 then
begin
DebugMsg('SplitRegParams','Malformed line (missing \): ' + pInf);
exit;
end;
oValue := Decode(Copy(oKey,d+1,Length(oKey)));
oKey := Copy(oKey,1,d-1);
end;
DebugMsg('SplitRegParams','Root: '+sRootKey+', Key:'+oKey + ', Value:'+oValue);
case sRootKey of
'HKCR': oRootKey := HKCR;
'HKLM': oRootKey := HKLM;
'HKU': oRootKey := HKU;
'HKCU': oRootKey := HKCU;
else
begin
DebugMsg('SplitRegParams','Unrecognised root key: ' + sRootKey);
exit;
end;
end;
Result := True;
end;
procedure UninstInfRegKey(const pInf: String; const pIfEmpty: Boolean);
var sKey,sVal: String;
iRootKey: Integer;
begin
sVal := 'nil';
if not SplitRegParams(pInf,iRootKey,sKey,sVal) then
exit;
if pIfEmpty then
begin
if not RegDeleteKeyIfEmpty(iRootKey,sKey) then
DebugMsg('UninstInfRegKey','RegDeleteKeyIfEmpty failed');
end
else
begin
if not RegDeleteKeyIncludingSubkeys(iRootKey,sKey) then
DebugMsg('UninstInfRegKey','RegDeleteKeyIncludingSubkeys failed');
end;
end;
procedure UninstInfRegVal(const pInf: String);
var sKey,sVal: String;
iRootKey: Integer;
begin
if not SplitRegParams(pInf,iRootKey,sKey,sVal) then
exit;
if not RegDeleteValue(iRootKey,sKey,sVal) then
DebugMsg('UninstInfREG','RegDeleteKeyIncludingSubkeys failed');
end;
procedure UninstInfFile(const pFile: String);
begin
DebugMsg('UninstInfFile','File: '+pFile);
if not DeleteFile(pFile) then
DebugMsg('UninstInfFile','DeleteFile failed');
end;
procedure UninstInfDir(const pDir: String);
begin
DebugMsg('UninstInfDir','Dir: '+pDir);
if not RemoveDir(pDir) then
DebugMsg('UninstInfDir','RemoveDir failed');
end;
procedure CreateMessageForm(var frmMessage: TForm; const pMessage: String);
var lblMessage: TNewStaticText;
begin
frmMessage := CreateCustomForm();
with frmMessage do
begin
BorderStyle := bsDialog;
ClientWidth := ScaleX(300);
ClientHeight := ScaleY(48);
Caption := CustomMessage('UninstallingAddOnCaption');
Position := poScreenCenter;
BorderIcons := [];
end;
lblMessage := TNewStaticText.Create(frmMessage);
with lblMessage do
begin
Parent := frmMessage;
AutoSize := True;
Caption := pMessage;
Top := (frmMessage.ClientHeight - Height) div 2;
Left := (frmMessage.ClientWidth - Width) div 2;
Visible := True;
end;
frmMessage.Show();
frmMessage.Refresh();
end;
procedure UninstInfRun(const pInf: String);
var Description,Prog,Params: String;
Split, ResultCode, Ctr: Integer;
frmMessage: TForm;
begin
DebugMsg('UninstInfRun',pInf);
Split := Pos('/',pInf);
if Split <> 0 then
begin
Description := Copy(pInf, 1, Split - 1);
Prog := Copy(pInf, Split + 1, Length(pInf));
end else
begin
Prog := pInf;
Description := '';
end;
Split := Pos('/',Prog);
if Split <> 0 then
begin
Params := Copy(Prog, Split + 1, Length(Prog));
Prog := Copy(Prog, 1, Split - 1);
end else
begin
Params := '';
end;
if not UninstallSilent then //can't manipulate uninstaller messages, so create a form instead
CreateMessageForm(frmMessage,Description);
DebugMsg('UninstInfRun','Running: ' + Prog + '; Params: ' + Params);
if Exec(Prog,Params,'',SW_SHOW,ewWaitUntilTerminated,ResultCode) then
begin
DebugMsg('UninstInfRun','Exec result: ' + IntToStr(ResultCode));
Ctr := 0;
while FileExists(Prog) do //wait a few seconds for the uninstaller to be deleted - since this is done by a program
begin //running from a temporary directory, the uninstaller we ran above will exit some time before
Sleep(UNINSTALL_CHECK_TIME); //it's removed from disk
Inc(Ctr);
if Ctr = (UNINSTALL_MAX_WAIT_TIME/UNINSTALL_CHECK_TIME) then //don't wait more than 5 seconds
break;
end;
end else
DebugMsg('UninstInfRun','Exec failed: ' + IntToStr(ResultCode) + ' (' + SysErrorMessage(ResultCode) + ')');
if not UninstallSilent then
frmMessage.Free();
end;
(*
uninst.inf documentation:
- Delete Registry keys (with all subkeys):
RegKey:<RootKey>/<SubKey>
RootKey = HKCR, HKLM, HKCU, HKU
SubKey = subkey to delete (warning: this will delete all keys under subkey, so be very careful with it)
- Delete empty registry keys:
RegKeyEmpty:<RootKey>/<SubKey>
RootKey = HKCR, HKLM, HKCU, HKU
SubKey = subkey to delete if empty
- Delete values from registry:
RegVal:<RootKey>/<SubKey>/Value
RootKey = HKCR, HKLM, HKCU, HKU
SubKey = subkey to delete Value from
Value = value to delete; \ and % must be escaped as %5c and %25
- Delete files:
File:<Path>
Path = full path to file
- Delete empty directories:
Dir:<Path>
- Run program with parameters:
Run:<description>/<path>/<params>
Directives are parsed from the end of the file backwards as the first step of uninstall.
IMPORTANT: From PIKA 2.10.12 onwards (Inno Setup 6 with support for per-user install), Registry keys referring to HKCR will be
processed by the installer as the first step of install (and the entries will be removed from uninst.inf), since file associations
code was rewritten.
*)
procedure ParseUninstInf();
var i,d: Integer;
sWhat: String;
begin
for i := GetArrayLength(asUninstInf) - 1 downto 0 do
begin
DebugMsg('ParseUninstInf',asUninstInf[i]);
if (Length(asUninstInf[i]) = 0) or (asUninstInf[i][1] = '#') then //skip comments and empty lines
continue;
d := Pos(':',asUninstInf[i]);
if d = 0 then
begin
DebugMsg('ParseUninstInf','Malformed line: ' + asUninstInf[i]);
continue;
end;
sWhat := Copy(asUninstInf[i],d+1,Length(asUninstInf[i]));
case Copy(asUninstInf[i],1,d) of
'RegKey:': UninstInfRegKey(sWhat,False);
'RegKeyEmpty:': UninstInfRegKey(sWhat,True);
'RegVal:': UninstInfRegVal(sWhat);
'File:': UninstInfFile(sWhat);
'Dir:': UninstInfDir(sWhat);
'Run:': UninstInfRun(sWhat);
end;
end;
end;
procedure CurUninstallStepChanged(CurStep: TUninstallStep);
begin
DebugMsg('CurUninstallStepChanged','');
case CurStep of
usUninstall:
begin
LoadStringsFromFile(ExpandConstant('{app}\uninst\uninst.inf'),asUninstInf);
ParseUninstInf();
end;
//usPostUninstall:
end;
end;
procedure AssociationsCleanUp();
var i, d, countNew,countUI: Integer;
asTemp, asNew: TArrayOfString;
sKey,sVal: String;
iRootKey: Integer;
begin
if FileExists(ExpandConstant('{app}\uninst\uninst.inf')) then
begin
DebugMsg('AssociationsCleanUp','Parsing old uninst.inf');
LoadStringsFromFile(ExpandConstant('{app}\uninst\uninst.inf'),asTemp);
countNew := 0;
countUI := 0;
SetArrayLength(asNew, GetArrayLength(asTemp));
SetArrayLength(asUninstInf, GetArrayLength(asTemp));
for i := 0 to GetArrayLength(asTemp) - 1 do //extract associations-related entries from uninst.inf
begin
if (Length(asTemp[i]) = 0) or (asTemp[i][1] = '#') then //comment/empty line
begin
asNew[countNew] := asTemp[i];
Inc(countNew);
continue;
end;
d := Pos(':',asTemp[i]);
if d = 0 then //something wrong, ignore
continue;
if Copy(asTemp[i],1,3) = 'Reg' then
begin
sVal := 'nil';
if not SplitRegParams(Copy(asTemp[i], d + 1, Length(asTemp[i])),iRootKey,sKey,sVal) then
continue; //malformed line, ignore
if iRootKey = HKCR then //old association, prepare for cleanup
begin
DebugMsg('AssociationsCleanUp','Preparing for cleanup: '+asTemp[i]);
asUninstInf[countUI] := asTemp[i];
Inc(countUI);
continue;
end;
end;
//something else, keep for new uninst.inf
asNew[countNew] := asTemp[i];
Inc(countNew);
end;
SetArrayLength(asNew, countNew);
SetArrayLength(asUninstInf, countUI);
SaveStringsToUTF8File(ExpandConstant('{app}\uninst\uninst.inf'), asNew, False); //replace uninst.inf with a cleaned one
ParseUninstInf(); //remove old associations
end;
end;

View File

@ -0,0 +1,177 @@
#if 0
[Code]
#endif
procedure DebugMsg(Const pProc,pMsg: String);
begin
Log('[Code] ' + pProc + #9 + pMsg);
end;
function BoolToStr(const b: Boolean): String;
begin
if b then
Result := 'True'
else
Result := 'False';
end;
function RevPos(const SearchStr, Str: string): Integer;
var i: Integer;
begin
if Length(SearchStr) < Length(Str) then
for i := (Length(Str) - Length(SearchStr) + 1) downto 1 do
begin
if Copy(Str, i, Length(SearchStr)) = SearchStr then
begin
Result := i;
exit;
end;
end;
Result := 0;
end;
function Replace(pSearchFor, pReplaceWith, pText: String): String;
begin
StringChangeEx(pText,pSearchFor,pReplaceWith,True);
Result := pText;
end;
function Count(What, Where: String): Integer;
begin
Result := 0;
if Length(What) = 0 then
exit;
while Pos(What,Where)>0 do
begin
Where := Copy(Where,Pos(What,Where)+Length(What),Length(Where));
Result := Result + 1;
end;
end;
//split text to array
procedure Explode(var ADest: TArrayOfString; aText, aSeparator: String);
var tmp: Integer;
begin
if aSeparator='' then
exit;
SetArrayLength(ADest,Count(aSeparator,aText)+1)
tmp := 0;
repeat
if Pos(aSeparator,aText)>0 then
begin
ADest[tmp] := Copy(aText,1,Pos(aSeparator,aText)-1);
aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
tmp := tmp + 1;
end else
begin
ADest[tmp] := aText;
aText := '';
end;
until Length(aText)=0;
end;
function String2Utf8(const pInput: String): AnsiString;
var Output: AnsiString;
ret, outLen, nulPos: Integer;
begin
outLen := WideCharToMultiByte(CP_UTF8, 0, pInput, -1, Output, 0, 0, 0);
Output := StringOfChar(#0,outLen);
ret := WideCharToMultiByte(CP_UTF8, 0, pInput, -1, Output, outLen, 0, 0);
if ret = 0 then
RaiseException('WideCharToMultiByte failed: ' + IntToStr(GetLastError));
nulPos := Pos(#0,Output) - 1;
if nulPos = -1 then
nulPos := Length(Output);
Result := Copy(Output,1,nulPos);
end;
function Utf82String(const pInput: AnsiString): String;
var Output: AnsiString;
ret, outLen, nulPos: Integer;
begin
outLen := MultiByteToWideChar(CP_UTF8, 0, pInput, -1, Output, 0);
Output := StringOfChar(#0,outLen);
ret := MultiByteToWideChar(CP_UTF8, 0, pInput, -1, Output, outLen);
if ret = 0 then
RaiseException('MultiByteToWideChar failed: ' + IntToStr(GetLastError));
nulPos := Pos(#0,Output) - 1;
if nulPos = -1 then
nulPos := Length(Output);
Result := Copy(Output,1,nulPos);
end;
function SaveStringToUTF8File(const pFileName, pS: String; const pAppend: Boolean): Boolean;
begin
Result := SaveStringToFile(pFileName, String2Utf8(pS), pAppend);
end;
function LoadStringFromUTF8File(const pFileName: String; var oS: String): Boolean;
var Utf8String: AnsiString;
begin
Result := LoadStringFromFile(pFileName, Utf8String);
oS := Utf82String(Utf8String);
end;
procedure StatusLabel(const Status1,Status2: string);
begin
WizardForm.StatusLabel.Caption := Status1;
WizardForm.FilenameLabel.Caption := Status2;
WizardForm.Refresh();
end;
//reverse encoding done by Encode
function Decode(pText: String): String;
var p: Integer;
tmp: String;
begin
if Pos('%',pText) = 0 then
Result := pText
else
begin
Result := '';
while Length(pText) > 0 do
begin
p := Pos('%',pText);
if p = 0 then
begin
Result := Result + pText;
break;
end;
Result := Result + Copy(pText,1,p-1);
tmp := '$' + Copy(pText,p+1,2);
Result := Result + Chr(StrToIntDef(tmp,32));
pText := Copy(pText,p+3,Length(pText));
end;
end;
end;

View File

@ -0,0 +1,26 @@
//set the version string
#define public
#if !Defined(VERSION)
#error "VERSION must be defined"
#endif
#define GTK_VER=GetFileVersion(AddBackslash(DEPS_DIR64) + "bin\libgtk-win32-2.0-0.dll")
#define public
//used in the component list
#define GTK_VERSION=Copy(GTK_VER,1,RPos(".",GTK_VER)-1)
#define MAJOR=Copy(VERSION,1,Pos(".",VERSION)-1)
#define MINOR=Copy(VERSION,Pos(".",VERSION)+1)
#define MICRO=Copy(MINOR,Pos(".",MINOR)+1)
#expr MINOR=Copy(MINOR,1,Pos(".",MINOR)-1)
#if Int(MINOR) % 2 == 1
#define DEVEL="-dev"
#define DIR_VER=MAJOR + "." + MINOR
#else
#define DEVEL=""
#define DIR_VER=MAJOR + ".0"
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB