chore(windows): remove buildpkg

This commit is contained in:
Marc Durdin 2023-09-25 06:00:39 +07:00
parent 10b2fa4fb5
commit 7dc8743cd3
8 changed files with 2 additions and 1401 deletions

View file

@ -8,7 +8,6 @@ We do not have 100% clean separation between Keyman Developer and Keyman for
Windows. Shared units are intended to live in common, however the following
projects will need to be updated in the future.
* buildpkg in Windows depends on various compiler units in multiple folders.
* kmbrowserhost in Windows is included as part of Keyman Developer.
# Folders

View file

@ -7,7 +7,7 @@ NOTARGET_SIGNCODE=yes
!ifdef NODELPHI
TARGETS=.virtual
!else
TARGETS=common buildpkg
TARGETS=common
!endif
CLEANS=clean-buildtools
@ -20,15 +20,10 @@ common: .virtual
cd $(KEYMAN_ROOT)\common\windows\delphi\tools
$(MAKE) $(TARGET)
buildpkg: .virtual
cd $(ROOT)\src\buildtools\buildpkg
$(MAKE) $(TARGET)
# ----------------------------------------------------------------------
clean-buildtools:
cd $(ROOT)\src\buildtools
-del version.txt
rem no action
!include ..\Target.mak

View file

@ -1,20 +0,0 @@
#
# Buildpkg Makefile
#
!include ..\..\Defines.mak
build: version.res dirs
$(DELPHI_MSBUILD) buildpkg.dproj "/p:Platform=Win32"
$(SENTRYTOOL_DELPHIPREP) $(WIN32_TARGET_PATH)\buildpkg.exe -dpr buildpkg.dpr
$(TDS2DBG) $(WIN32_TARGET_PATH)\buildpkg.exe
$(COPY) $(WIN32_TARGET_PATH)\Buildpkg.exe $(PROGRAM)\online
$(COPY) $(WIN32_TARGET_PATH)\Buildpkg.exe $(PROGRAM)\buildtools
if exist $(WIN32_TARGET_PATH)\buildpkg.dbg $(COPY) $(WIN32_TARGET_PATH)\buildpkg.dbg $(DEBUGPATH)\buildtools
clean: def-clean
signcode:
$(SIGNCODE) /d "Package Installer Creator for Server" $(PROGRAM)\online\Buildpkg.exe
!include ..\..\Target.mak

View file

@ -1,74 +0,0 @@
program buildpkg;
{$APPTYPE CONSOLE}
uses
SysUtils,
buildpkgmain in 'buildpkgmain.pas',
CompilePackageInstaller in '..\..\..\..\developer\src\common\delphi\compiler\CompilePackageInstaller.pas',
utilsystem in '..\..\..\..\common\windows\delphi\general\utilsystem.pas',
CompilePackage in '..\..\..\..\developer\src\common\delphi\compiler\CompilePackage.pas',
kmpinffile in '..\..\..\..\common\windows\delphi\packages\kmpinffile.pas',
kpsfile in '..\..\..\..\developer\src\common\delphi\packages\kpsfile.pas',
PackageInfo in '..\..\..\..\common\windows\delphi\packages\PackageInfo.pas',
utildir in '..\..\..\..\common\windows\delphi\general\utildir.pas',
utilstr in '..\..\..\..\common\windows\delphi\general\utilstr.pas',
utilfiletypes in '..\..\..\..\common\windows\delphi\general\utilfiletypes.pas',
Unicode in '..\..\..\..\common\windows\delphi\general\Unicode.pas',
VersionInfo in '..\..\..\..\common\windows\delphi\general\VersionInfo.pas',
PackageFileFormats in '..\..\..\..\common\windows\delphi\packages\PackageFileFormats.pas',
GetOsVersion in '..\..\..\..\common\windows\delphi\general\GetOsVersion.pas',
RegistryKeys in '..\..\..\..\common\windows\delphi\general\RegistryKeys.pas',
KeymanDeveloperOptions in '..\..\..\..\developer\src\tike\main\KeymanDeveloperOptions.pas',
RedistFiles in '..\..\..\..\developer\src\tike\main\RedistFiles.pas',
DebugPaths in '..\..\..\..\common\windows\delphi\general\DebugPaths.pas',
CustomisationStorage in '..\..\global\delphi\cust\CustomisationStorage.pas',
StockFileNames in '..\..\..\..\common\windows\delphi\general\StockFileNames.pas',
klog in '..\..\..\..\common\windows\delphi\general\klog.pas',
httpuploader in '..\..\..\..\common\windows\delphi\general\httpuploader.pas',
Upload_Settings in '..\..\..\..\common\windows\delphi\general\Upload_Settings.pas',
UfrmTike in '..\..\..\..\developer\src\tike\main\UfrmTike.pas' {TikeForm: TTntForm},
utilhttp in '..\..\..\..\common\windows\delphi\general\utilhttp.pas',
kmxfile in '..\..\..\..\common\windows\delphi\keyboards\kmxfile.pas',
utilkeyboard in '..\..\..\..\common\windows\delphi\keyboards\utilkeyboard.pas',
KeyNames in '..\..\..\..\common\windows\delphi\general\KeyNames.pas',
wininet5 in '..\..\..\..\common\windows\delphi\general\wininet5.pas',
GlobalProxySettings in '..\..\..\..\common\windows\delphi\general\GlobalProxySettings.pas',
ErrorControlledRegistry in '..\..\..\..\common\windows\delphi\vcl\ErrorControlledRegistry.pas',
utilexecute in '..\..\..\..\common\windows\delphi\general\utilexecute.pas',
KeymanVersion in '..\..\..\..\common\windows\delphi\general\KeymanVersion.pas',
Glossary in '..\..\..\..\common\windows\delphi\general\Glossary.pas',
Keyman.Developer.System.Project.ProjectLog in '..\..\..\..\developer\src\tike\project\Keyman.Developer.System.Project.ProjectLog.pas',
UserMessages in '..\..\..\..\common\windows\delphi\general\UserMessages.pas',
VisualKeyboard in '..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboard.pas',
VisualKeyboardLoaderBinary in '..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboardLoaderBinary.pas',
VisualKeyboardLoaderXML in '..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboardLoaderXML.pas',
VisualKeyboardSaverBinary in '..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboardSaverBinary.pas',
VisualKeyboardSaverXML in '..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboardSaverXML.pas',
TempFileManager in '..\..\..\..\common\windows\delphi\general\TempFileManager.pas',
ExtShiftState in '..\..\..\..\common\windows\delphi\visualkeyboard\ExtShiftState.pas',
VKeyChars in '..\..\..\..\common\windows\delphi\general\VKeyChars.pas',
VKeys in '..\..\..\..\common\windows\delphi\general\VKeys.pas',
JsonUtil in '..\..\..\..\common\windows\delphi\general\JsonUtil.pas',
Keyman.System.PackageInfoRefreshKeyboards in '..\..\..\..\developer\src\common\delphi\packages\Keyman.System.PackageInfoRefreshKeyboards.pas',
Keyman.System.KMXFileLanguages in '..\..\..\..\developer\src\common\delphi\keyboards\Keyman.System.KMXFileLanguages.pas',
Keyman.System.Standards.ISO6393ToBCP47Registry in '..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.ISO6393ToBCP47Registry.pas',
Keyman.System.Standards.LCIDToBCP47Registry in '..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.LCIDToBCP47Registry.pas',
Keyman.System.KeyboardJSInfo in '..\..\..\..\developer\src\common\delphi\keyboards\Keyman.System.KeyboardJSInfo.pas',
Keyman.System.KeyboardUtils in '..\..\..\..\developer\src\common\delphi\keyboards\Keyman.System.KeyboardUtils.pas',
Keyman.System.LanguageCodeUtils in '..\..\..\..\common\windows\delphi\general\Keyman.System.LanguageCodeUtils.pas',
Keyman.System.RegExGroupHelperRSP19902 in '..\..\..\..\common\windows\delphi\vcl\Keyman.System.RegExGroupHelperRSP19902.pas',
kmxfileconsts in '..\..\..\..\common\windows\delphi\keyboards\kmxfileconsts.pas',
BCP47Tag in '..\..\..\..\common\windows\delphi\general\BCP47Tag.pas',
Keyman.System.Standards.BCP47SubtagRegistry in '..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.BCP47SubtagRegistry.pas',
Keyman.System.Standards.BCP47SuppressScriptRegistry in '..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.BCP47SuppressScriptRegistry.pas',
Keyman.System.CanonicalLanguageCodeUtils in '..\..\..\..\common\windows\delphi\general\Keyman.System.CanonicalLanguageCodeUtils.pas',
Keyman.System.LexicalModelUtils in '..\..\..\..\developer\src\common\delphi\lexicalmodels\Keyman.System.LexicalModelUtils.pas',
Keyman.System.PackageInfoRefreshLexicalModels in '..\..\..\..\developer\src\common\delphi\packages\Keyman.System.PackageInfoRefreshLexicalModels.pas',
Keyman.System.Standards.LangTagsRegistry in '..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.LangTagsRegistry.pas',
KeymanPaths in '..\..\..\..\common\windows\delphi\general\KeymanPaths.pas',
Keyman.Developer.System.KeymanDeveloperPaths in '..\..\..\..\developer\src\tike\main\Keyman.Developer.System.KeymanDeveloperPaths.pas';
begin
Run;
end.

File diff suppressed because it is too large Load diff

View file

@ -1,214 +0,0 @@
(*
Name: buildpkgmain
Copyright: Copyright (C) SIL International.
Documentation:
Description:
Create Date: 23 Aug 2007
Modified Date: 22 Jun 2015
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 23 Aug 2007 - mcdurdin - Initial version
17 Sep 2007 - mcdurdin - Support output path parameter
30 Dec 2010 - mcdurdin - I2562 - EULA as part of setup bootstrapper
04 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls
23 Feb 2015 - mcdurdin - I4598 - V9.0 - Keyman installer does not show EULA when bundled with a keyboard
04 May 2015 - mcdurdin - I4694 - V9.0 - Split UI actions from non-UI actions in projects
11 May 2015 - mcdurdin - I4706 - V9.0 - Update compile logging for silent and warning-as-error cleanness
22 Jun 2015 - mcdurdin - I4763 - Package compiler (buildpkg) needs to specify username and password on command line
22 Jun 2015 - mcdurdin - I4764 - Buildpkg needs to support different paths for msi and kmp files
*)
unit buildpkgmain; // I3306
interface
procedure Run;
implementation
uses
Winapi.Windows,
CompilePackageInstaller,
kpsfile,
Keyman.Developer.System.Project.ProjectLog,
SysUtils;
type
TParams = class
private
TooManyParams: Boolean;
public
OutputPath, RedistPath, MSIFileName, KMPFileName, KMPName, AppName, LicenseFileName, TitleImageFileName: WideString; // I2562 // I4763
StartDisabled, StartWithConfiguration: Boolean;
constructor Create;
function Validate: Boolean;
function Completed: Boolean;
procedure CompilerMessage(Sender: TObject; msg: string; State: TProjectLogState); // I4706
end;
procedure Run;
var
Params: TParams;
pack: TKPSFile;
begin
Params := TParams.Create;
if not Params.Completed then
begin
writeln('buildpkg.exe 1.0');
writeln('Usage: '+ExtractFileName(ParamStr(0))+' -m <msi filename> [-l <License filename>] [-i <TitleImage filename>] [-a <app name>] (-s <setup.exe folder location>)|(-n <kmp description> <kmp filename>)'); // I2562 // I4763
writeln('If setup-redist.exe is in setup folder location, it will be used in preference to setup.exe');
ExitCode := 3;
Exit;
end;
if not Params.Validate then
begin
writeln('buildpkg.exe 1.0');
ExitCode := 4;
Exit;
end;
if Params.KMPFileName <> '' then
begin
pack := TKPSFile.Create;
pack.KPSOptions.MSIFileName := Params.MSIFileName;
pack.FileName := ChangeFileExt(Params.KMPFileName, '.kps');
pack.Info.Desc['Name'] := Params.KMPName;
try
if not DoCompilePackageInstaller(pack, Params.CompilerMessage, False, Params.MSIFileName,
ChangeFileExt(Params.MSIFileName,'')+'-'+ChangeFileExt(ExtractFileName(Params.KMPFileName),'')+'.exe', Params.RedistPath,
False, False, Params.LicenseFileName, Params.TitleImageFileName, Params.AppName,
Params.StartDisabled, Params.StartWithConfiguration) then // I4598 // I4694 // I4764
ExitCode := 1
else
ExitCode := 0;
except
on E:Exception do
begin
writeln(E.Message);
ExitCode := 2;
end;
end;
end
else
begin
try
if Params.OutputPath = '' then
Params.OutputPath := ChangeFileExt(Params.MSIFileName, '.exe');
if not DoCompileMSIInstaller(Params.CompilerMessage, False, Params.MSIFileName, Params.OutputPath, Params.RedistPath,
Params.LicenseFileName, Params.TitleImageFileName, Params.AppName,
Params.StartDisabled, Params.StartWithConfiguration) then // I2562
ExitCode := 1
else
ExitCode := 0;
except
on E:Exception do
begin
writeln(E.Message);
ExitCode := 2;
end;
end;
end;
end;
{ TParams }
procedure TParams.CompilerMessage(Sender: TObject; msg: string;
State: TProjectLogState); // I4706
begin
if State in [plsError, plsFatal]
then raise Exception.Create(msg)
else writeln(msg);
end;
function TParams.Completed: Boolean;
begin
Result :=
not TooManyParams and
(MSIFileName <> '') and
(
((KMPFileName = '') and (RedistPath <> '')) or
((KMPFileName <> '') and (KMPName <> ''))
);
end;
constructor TParams.Create;
var
i: Integer;
Flag: WideString;
begin
{ Takes a .kmp file and turns it into a .msi installer }
i := 1;
while i <= ParamCount do
begin
Flag := ParamStr(i); Inc(i);
if Flag = '-m' then
MSIFileName := ParamStr(i)
else if Flag = '-n' then
KMPName := ParamStr(i)
else if Flag = '-s' then
RedistPath := IncludeTrailingPathDelimiter(ParamStr(i))
else if Flag = '-o' then
OutputPath := ParamStr(i)
else if Flag = '-l' then // I2562
LicenseFileName := ParamStr(i)
else if Flag = '-i' then
TitleImageFileName := ParamStr(i)
else if Flag = '-a' then
AppName := ParamStr(i)
else if SameText(Flag, '-startDisabled') then
begin
Dec(i); StartDisabled := True;
end
else if SameText(Flag, '-startWithConfiguration') then
begin
Dec(i); StartWithConfiguration := True;
end
else
begin
KMPFileName := Flag;
Break;
end;
Inc(i);
end;
TooManyParams := i <= ParamCount;
end;
function TParams.Validate: Boolean;
begin
Result := True;
if not FileExists(MSIFileName) then
begin
Result := False;
writeln('File '+MSIFileName+' does not exist.');
end;
if (KMPFileName <> '') and not FileExists(KMPFileName) then
begin
Result := False;
writeln('File '+KMPFileName+' does not exist.');
end;
if (LicenseFileName <> '') and not FileExists(LicenseFileName) then // I2562
begin
Result := False;
writeln('License File '+LicenseFileName+' does not exist.');
end;
if (RedistPath <> '') and (not FileExists(RedistPath + 'setup.exe') or not FileExists(RedistPath + 'setup-redist.exe')) then
begin
Result := False;
writeln('File '+RedistPath+'setup.exe and '+RedistPath+'setup-redist.exe do not exist.');
end;
end;
end.

View file

@ -1,32 +0,0 @@
#include "../../../../common/windows/cpp/include/keymanversion.h"
1 VERSIONINFO
FILEVERSION KV_FILEVERSION
PRODUCTVERSION KV_PRODUCTVERSION
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "0C0904E4"
BEGIN
VALUE "CompanyName", KV_COMPANY_NAME
VALUE "FileDescription", "Buildpkg\0"
VALUE "FileVersion", KV_VERSION_STRING
VALUE "InternalName", "BUILDPKG\0"
VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT
VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS
VALUE "OriginalFilename", "BUILDPKG.EXE\0"
VALUE "ProductName", "Keyman Build Environment\0"
VALUE "ProductVersion", KV_VERSION_STRING
VALUE "Comments", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0xc09, 1252
END
END