diff --git a/developer/src/README.md b/developer/src/README.md index 211b6ab0071..5d923dd4646 100644 --- a/developer/src/README.md +++ b/developer/src/README.md @@ -8,9 +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. - -- should be removed as part of 17.0. - * kmbrowserhost in Windows is included as part of Keyman Developer. # Folders diff --git a/developer/src/common/delphi/compiler/CompilePackage.pas b/developer/src/common/delphi/compiler/CompilePackage.pas deleted file mode 100644 index c7c5e071235..00000000000 --- a/developer/src/common/delphi/compiler/CompilePackage.pas +++ /dev/null @@ -1,540 +0,0 @@ -(* - Name: CompilePackage - Copyright: Copyright (C) SIL International. - Documentation: - Description: - Create Date: 20 Jun 2006 - - Modified Date: 11 May 2015 - Authors: mcdurdin - Related Files: - Dependencies: - - Bugs: - Todo: - Notes: - History: 20 Jun 2006 - mcdurdin - Initial version - 04 Dec 2006 - mcdurdin - Add message for missing files when compiling package - 04 Jun 2007 - mcdurdin - Remove unused KeymanPath - 20 Jun 2007 - mcdurdin - Remove unused ActivationManager reference - 19 Nov 2007 - mcdurdin - I1157 - const string parameters - 04 May 2015 - mcdurdin - I4688 - V9.0 - Add build path to project settings - 04 May 2015 - mcdurdin - I4690 - V9.0 - Pull keyboard version into package version when adding a keyboard - 11 May 2015 - mcdurdin - I4706 - V9.0 - Update compile logging for silent and warning-as-error cleanness -*) -unit CompilePackage; - -interface - -uses - kpsfile, - kmpinffile, - PackageInfo, - Keyman.Developer.System.Project.ProjectLog; - -function DoCompilePackage(pack: TKPSFile; AMessageEvent: TCompilePackageMessageEvent; ASilent, ACheckFilenameConventions: Boolean; const AOutputFileName: string): Boolean; // I4688 - -implementation - -uses - Winapi.Windows, - System.Classes, - System.Generics.Collections, - System.SysUtils, - System.IniFiles, - System.Zip, - - VisualKeyboard, - utilfiletypes, - ErrorControlledRegistry, - RegistryKeys, - kmxfile, - KeymanDeveloperOptions, - KeymanVersion, - - Keyman.System.KeyboardUtils, - Keyman.System.LexicalModelUtils, - Keyman.System.CanonicalLanguageCodeUtils, - Keyman.System.PackageInfoRefreshKeyboards, - Keyman.System.PackageInfoRefreshLexicalModels, - - RedistFiles, - TempFileManager, - VersionINfo; - -type - TCompilePackage = class - private - FSilent: Boolean; - FOnMessage: TCompilePackageMessageEvent; - FTempPath: string; - //FRuntimeSourcePath: string; - pack: TKPSFile; - - FOutputFileName: string; - FTempFiles: TTempFiles; - FCheckFilenameConventions: Boolean; - - procedure FatalMessage(const msg: string); - procedure WriteMessage(AState: TProjectLogState; const msg: string); // I4706 - - function BuildKMP: Boolean; - - constructor Create(APack: TKPSFile; AMessageEvent: TCompilePackageMessageEvent; ASilent, ACheckFilenameConventions: Boolean; const AOutputFileName: string); // I4688 - destructor Destroy; override; - function Compile: Boolean; - procedure CheckForDangerousFiles; - procedure CheckKeyboardVersions; - procedure CheckKeyboardLanguages; - procedure CheckFilenameConventions; - function CheckLexicalModels: Boolean; - procedure CheckForDuplicatedLanguages(const resourceType, id: string; languages: TPackageKeyboardLanguageList); - end; - -function DoCompilePackage(pack: TKPSFile; AMessageEvent: TCompilePackageMessageEvent; ASilent, ACheckFilenameConventions: Boolean; const AOutputFileName: string): Boolean; // I4688 -begin - with TCompilePackage.Create(pack, AMessageEvent, ASilent, ACheckFilenameConventions, AOutputFileName) do // I4688 - try - Result := Compile; - finally - Free; - end; -end; - - -constructor TCompilePackage.Create(APack: TKPSFile; AMessageEvent: TCompilePackageMessageEvent; ASilent, ACheckFilenameConventions: Boolean; const AOutputFileName: string); // I4688 -begin - inherited Create; - pack := APack; - FOnMessage := AMessageEvent; - FSilent := ASilent; - FOutputFileName := AOutputFileName; - FTempFiles := TTempFiles.Create; - FCheckFilenameConventions := ACheckFilenameConventions; -end; - -destructor TCompilePackage.Destroy; -begin - FreeAndNil(FTempFiles); - inherited Destroy; -end; - -procedure TCompilePackage.CheckFilenameConventions; -var - i: Integer; -begin - if not FCheckFilenameConventions then - Exit; - - if pack.LexicalModels.Count > 0 then - begin - if not TLexicalModelUtils.DoesPackageFilenameFollowLexicalModelConventions(pack.FileName) then - WriteMessage(plsWarning, Format(TKeyboardUtils.SPackageNameDoesNotFollowLexicalModelConventions_Message, [ExtractFileName(pack.FileName)])); - end - else - begin - if not TKeyboardUtils.DoesKeyboardFilenameFollowConventions(pack.FileName) then - WriteMessage(plsWarning, Format(TKeyboardUtils.SKeyboardNameDoesNotFollowConventions_Message, [ExtractFileName(pack.FileName)])); - end; - - for i := 0 to pack.Files.Count - 1 do - begin - if not TKeyboardUtils.DoesFilenameFollowConventions(pack.Files[i].FileName) then - WriteMessage(plsWarning, Format(TKeyboardUtils.SFilenameDoesNotFollowConventions_Message, [ExtractFileName(pack.Files[i].FileName)])); - end; -end; - -function TCompilePackage.CheckLexicalModels: Boolean; -var - model: TPackageLexicalModel; -begin - if pack.LexicalModels.Count > 0 then - begin - if pack.Keyboards.Count > 0 then - begin - FatalMessage('The package contains both lexical models and keyboards, which is not permitted.'); - Exit(False); - end; - end; - - for model in pack.LexicalModels do - begin - CheckForDuplicatedLanguages('model', model.id, model.Languages); - end; - - - Exit(True); -end; - -function TCompilePackage.Compile: Boolean; -var - buf: array[0..260] of Char; - n: Integer; - b: Boolean; - f: TSearchRec; -begin - Result := False; - - if pack.FileName = '' then - begin - FatalMessage('You need to save the package before building.'); - Exit; - end; - - WriteMessage(plsInfo, 'Compiling package ' + ExtractFileName(pack.FileName) + '...'); - - if Trim(pack.Info.Desc[PackageInfo_Name]) = '' then - begin - FatalMessage('You need to fill in the package name before building.'); - Exit; - end; - - CheckFilenameConventions; - CheckForDangerousFiles; - CheckKeyboardVersions; - CheckKeyboardLanguages; - if not CheckLexicalModels then Exit; - - GetTempPath(260, buf); - FTempPath := buf; - - GetTempFileName(PChar(FTempPath), 'kmn', 0, buf); - FTempPath := buf + '.dir'; - b := CreateDir(FTempPath); - if not b then - begin - FatalMessage('Unable to create temp folder '+FTempPath); - if FileExists(buf) then DeleteFile(buf); - Exit; - end; - - try - Result := BuildKMP; - finally - n := FindFirst(FTempPath + '\*.*', 0, f); - if n = 0 then - begin - while n = 0 do - begin - DeleteFile(FTempPath + '\' + f.Name); - n := FindNext(f); - end; - FindClose(f); - end; - RemoveDirectory(PChar(FTempPath)); - if FileExists(buf) then DeleteFile(buf); - end; -end; - - -function TCompilePackage.BuildKMP: Boolean; -var - kmpinf: TKMPInfFile; - psf: TPackageContentFile; - FPackageVersion: string; - i: Integer; - f: TTempFile; -begin - Result := False; - - kmpinf := TKMPInfFile.Create; - try - { Create KMP.INF and KMP.JSON } - - kmpinf.Assign(pack); - - // Add keyboard information to the package 'for free' - // Note: this does not get us very far for mobile keyboards as - // they still require the .js to be added by the developer at this stage. - // But it ensures that all keyboards in the package are listed in the - // {Keyboards} section - - with TPackageInfoRefreshKeyboards.Create(kmpinf) do - try - OnError := Self.FOnMessage; - if not Execute then - begin - WriteMessage(plsError, 'The package build was not successful.'); - Exit; - end; - finally - Free; - end; - - with TPackageInfoRefreshLexicalModels.Create(kmpinf) do - try - OnError := Self.FOnMessage; - if not Execute then - begin - WriteMessage(plsError, 'The package build was not successful.'); - Exit; - end; - finally - Free; - end; - - // - // Update the package version to the current compiled - // keyboard version. - // - - if pack.KPSOptions.FollowKeyboardVersion then - begin - if kmpinf.Keyboards.Count = 0 then - begin - FatalMessage('The option "Follow Keyboard Version" is set but there are no keyboards in the package.'); - Exit; - end; - - FPackageVersion := kmpinf.Keyboards[0].Version; - for i := 1 to kmpinf.Keyboards.Count - 1 do - if kmpinf.Keyboards[i].Version <> FPackageVersion then - begin - FatalMessage( - 'The option "Follow Keyboard Version" is set but the package contains more than one keyboard, '+ - 'and the keyboards have mismatching versions.'); - Exit; - end; - - kmpinf.Info.Desc[PackageInfo_Version] := FPackageVersion; - end; - - kmpinf.RemoveFilePaths; - - // - // Find the minimum package version based on keyboard version - // See also MergeKeyboardInfo.pas - // - - if kmpinf.LexicalModels.Count = 0 then - begin - kmpinf.Options.FileVersion := SKeymanVersion70; - - for i := 0 to kmpinf.Keyboards.Count - 1 do - begin - if CompareVersions(kmpinf.Options.FileVersion, kmpinf.Keyboards[i].MinKeymanVersion) > 0 then - begin - // Keyman for Windows 14 and earlier only accepted version 7.0 for keyboard - // packages, so we must not write any other version in order to allow - // earlier versions of Keyman to load the package. - if CompareVersions(kmpinf.Keyboards[i].MinKeymanVersion, SKeymanVersion150) <= 0 then - begin - kmpinf.Options.FileVersion := kmpinf.Keyboards[i].MinKeymanVersion; - end; - end; - end; - - psf := TPackageContentFile.Create(kmpinf); - psf.FileName := 'kmp.inf'; - psf.Description := 'Package information'; - psf.CopyLocation := pfclPackage; - - kmpinf.Files.Add(psf); - end - else - begin - // TODO: min model version is always 12.0 currently - // but we may need to support this in future - kmpinf.Options.FileVersion := SKeymanVersion120; - end; - - // - // Prepare and save - // - - psf := TPackageContentFile.Create(kmpinf); - psf.FileName := 'kmp.json'; - psf.Description := 'Package information (JSON)'; - psf.CopyLocation := pfclPackage; - - kmpinf.Files.Add(psf); - - kmpinf.FileName := FTempPath + '\kmp.inf'; - kmpinf.SaveIni; - - kmpinf.FileName := FTempPath + '\kmp.json'; - kmpinf.SaveJSON; - finally - kmpinf.Free; - end; - - try - ForceDirectories(ExtractFileDir(FOutputFilename)); - if FileExists(FOutputFilename) then - DeleteFile(FOutputFilename); - - { Create output file } - - try - - if FileExists(FOutputFilename) then DeleteFile(FOutputFilename); - - with TZipFile.Create do - try - Open(FOutputFilename, TZipMode.zmWrite); - Add(FTempPath + '\kmp.inf'); - Add(FTempPath + '\kmp.json'); - for i := 0 to pack.Files.Count - 1 do - begin - if not FileExists(pack.Files[i].FileName) then - WriteMessage(plsWarning, 'File '+pack.Files[i].FileName+' does not exist.') - else - begin - // When compiling the package, save the kvk keyboard into binary for delivery - if pack.Files[i].FileType = ftVisualKeyboard then - begin - f := TTempFileManager.Get('.kvk'); - FTempFiles.Add(f); - with TVisualKeyboard.Create do - try - try - LoadFromFile(pack.Files[i].FileName); - except - on E:EVisualKeyboardLoader do - begin - WriteMessage(plsError, pack.Files[i].FileName+' is invalid: '+E.Message); - Continue; - end; - end; - SaveToFile(f.Name, kvksfBinary); - finally - Free; - end; - Add(f.Name, ExtractFileName(pack.Files[i].FileName)); - end - else - Add(pack.Files[i].FileName); - end; - end; - if FileCount < pack.Files.Count + 2 then - WriteMessage(plsError, 'The build was not successful. Some files were skipped.') - else - begin - Result := True; - end; - Close; - finally - Free; - end; - except - on E:EZipException do - begin - WriteMessage(plsError, E.Message); - end; - end; - finally - if not Result then - if FileExists(FOutputFilename) then DeleteFile(FOutputFilename); - end; -end; - -procedure TCompilePackage.FatalMessage(const msg: string); -begin - FOnMessage(Self, msg, plsFatal); // I4706 -end; - -procedure TCompilePackage.WriteMessage(AState: TProjectLogState; const msg: string); // I4706 -begin - FOnMessage(Self, msg, AState); // I4706 -end; - -const - SKKeymanRedistFileShouldNotBeInPackage = 'The Keyman system file ''%0:s'' should not be compiled into the package. Use a redistributable installer instead.'; - SKDocFilesDangerous = 'Microsoft Word .doc or .docx files (''%0:s'') are not portable. You should instead use HTML or PDF format.'; - -procedure TCompilePackage.CheckForDangerousFiles; -var - i, j: Integer; - s: string; -begin - for i := 0 to pack.Files.Count - 1 do - begin - s := LowerCase(ExtractFileName(pack.Files[i].FileName)); - for j := Low(CRedistFiles) to High(CRedistFiles) do - if s = CRedistFiles[j].FileName then - WriteMessage(plsWarning, Format(SKKeymanRedistFileShouldNotBeInPackage, [s])); - for j := Low(CRuntimeFiles) to High(CRuntimeFiles) do - if s = CRuntimeFiles[j].FileName then - WriteMessage(plsWarning, Format(SKKeymanRedistFileShouldNotBeInPackage, [s])); - if (ExtractFileExt(s) = '.doc') or (ExtractFileExt(s) = '.docx') then WriteMessage(plsWarning, Format(SKDocFilesDangerous, [s])); - end; -end; - -const - SKKeyboardPackageVersionMismatch = 'The keyboard %0:s has version %1:s, which differs from the package version %2:s.'; - -procedure TCompilePackage.CheckKeyboardVersions; // I4690 -var - n, i: Integer; - ki: TKeyboardInfo; -begin - n := 0; - - // The version information is checked separately if we use - // 'follow keyboard version' - if pack.KPSOptions.FollowKeyboardVersion then - Exit; - - for i := 0 to pack.Files.Count - 1 do - if pack.Files[i].FileType = ftKeymanFile then Inc(n); - - // We only test for keyboard <> package version if 1 keyboard in package - // For multi-keyboard packages, it isn't sensible to do the same - if n <> 1 then - Exit; - - for i := 0 to pack.Files.Count - 1 do - begin - if pack.Files[i].FileType <> ftKeymanFile then Continue; - if not FileExists(pack.Files[i].FileName) then Continue; - - GetKeyboardInfo(pack.Files[i].FileName, True, ki); - if ki.KeyboardVersion <> pack.Info.Desc[PackageInfo_Version] then - WriteMessage(plsWarning, Format(SKKeyboardPackageVersionMismatch, - [ExtractFileName(pack.Files[i].FileName), ki.KeyboardVersion, pack.Info.Desc[PackageInfo_Version]])); - ki.MemoryDump.Free; - end; -end; - -const - SKKeyboardPackageLanguageNonCanonical = 'The keyboard %0:s has a non-canonical language tag "%1:s" (%2:s), should be "%3:s".'; - SKKeyboardShouldHaveAtLeastOneLanguage = 'The keyboard %0:s has no language tags. It should have at least one language tag.'; - SKPackageShouldNotRepeatLanguages = 'The %0:s %1:s has a repeated language "%2:s".'; - -procedure TCompilePackage.CheckKeyboardLanguages; -var - k: TPackageKeyboard; -begin - for k in pack.Keyboards do - begin - if k.Languages.Count = 0 then - WriteMessage(plsWarning, Format(SKKeyboardShouldHaveAtLeastOneLanguage, [k.ID])); - CheckForDuplicatedLanguages('keyboard', k.ID, k.Languages); - end; -end; - -procedure TCompilePackage.CheckForDuplicatedLanguages(const resourceType, id: string; languages: TPackageKeyboardLanguageList); -var - tags: TDictionary; - lang: TPackageKeyboardLanguage; -begin - tags := TDictionary.Create; - try - for lang in languages do - begin - if tags.ContainsKey(lang.ID.ToLower) then - begin - WriteMessage(plsWarning, Format(SKPackageShouldNotRepeatLanguages, [resourceType, id, lang.ID])); - end - else - begin - tags.Add(lang.ID.ToLower, 0); - end; - end; - finally - tags.Free; - end; -end; - -end. - diff --git a/developer/src/common/delphi/compiler/CompilePackageInstaller.pas b/developer/src/common/delphi/compiler/CompilePackageInstaller.pas deleted file mode 100644 index aae46e6732e..00000000000 --- a/developer/src/common/delphi/compiler/CompilePackageInstaller.pas +++ /dev/null @@ -1,446 +0,0 @@ -(* - Name: CompilePackageInstaller - Copyright: Copyright (C) SIL International. - Documentation: - Description: - Create Date: 4 Jun 2007 - - Modified Date: 6 Jun 2015 - Authors: mcdurdin - Related Files: - Dependencies: - - Bugs: - Todo: - Notes: - History: 04 Jun 2007 - mcdurdin - Initial version - 05 Jun 2007 - mcdurdin - I817 - Fix Unicode .inf file (not available on 9x) - 19 Jun 2007 - mcdurdin - I817 - Use Unicode .inf file again - 20 Jun 2007 - mcdurdin - Support compiling package installer from a .kmp file - 23 Aug 2007 - mcdurdin - Support building an exe installer without any embedded kmp files - 19 Nov 2007 - mcdurdin - I1157 - const string parameters - 28 Jul 2008 - mcdurdin - I1558 - Embed graphic file into setup.exe - 28 Jul 2008 - mcdurdin - I1559 - Support custom setup.exe strings - 05 Aug 2008 - mcdurdin - Don't crash if FPack is not assigned - 30 Dec 2010 - mcdurdin - I2562 - EULA as part of setup bootstrapper - 04 Nov 2011 - mcdurdin - I3126 - Add flag to allow install with full msi UI - 04 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support - 08 Jun 2012 - mcdurdin - I3337 - V9.0 - Review of input/output for Unicode - 06 Feb 2012 - mcdurdin - I2971 - TIKE maintains an open handle to .msi when compiling package installer - 04 Nov 2012 - mcdurdin - I3543 - V9.0 - Merge of I2971 - TIKE maintains an open handle to .msi when compiling package installer - 23 Feb 2015 - mcdurdin - I4598 - V9.0 - Keyman installer does not show EULA when bundled with a keyboard - 04 May 2015 - mcdurdin - I4688 - V9.0 - Add build path to project settings - 11 May 2015 - mcdurdin - I4706 - V9.0 - Update compile logging for silent and warning-as-error cleanness - 06 Jun 2015 - mcdurdin - I4741 - Package installer compiler references wrong path for compiled package file -*) -unit CompilePackageInstaller; // I3306 - -interface - -uses Windows, kpsfile, kmpinffile, PackageInfo, CompilePackage, - Keyman.Developer.System.Project.Projectlog, - jwaMsi, jwaMsiQuery, SysUtils; - -function DoCompilePackageInstaller(pack: TKPSFile; FMessageEvent: TCompilePackageMessageEvent; FSilent: Boolean; - AInstallerMSI, AOutputFilename, ARedistSetupPath: string; - AUpdateInstaller: Boolean; ABuildPackage: Boolean; ALicense, ATitleImage, AAppName: string; - AStartDisabled, AStartWithConfiguration: Boolean): Boolean; // I4598 // I4688 -function DoCompileMSIInstaller(FMessageEvent: TCompilePackageMessageEvent; FSilent: Boolean; - AInstallerMSI, AOutputFilename, ARedistSetupPath, ALicense, ATitleImage, AAppName: string; - AStartDisabled, AStartWithConfiguration: Boolean): Boolean; // I2562 - -implementation - -uses - System.Classes, - System.Zip, - RedistFiles, - utildir, - utilsystem; - -type - ECompilePackageInstaller = class(Exception); - - TCompilePackageInstaller = class - private - FOnMessage: TCompilePackageMessageEvent; - FPack: TKPSFile; - FSilent: Boolean; - FVersion: WideString; - FTempPath: WideString; - FProductName: WideString; - FRedistSetupPath: string; - FInstallerMSI: WideString; - FUpdateInstaller: Boolean; - FBuildPackage: Boolean; - FOutputFilename: string; - FLicense: string; // I2562 - FTitleImage: string; - FAppName: string; - FStartDisabled: Boolean; - FStartWithConfiguration: Boolean; - procedure FatalMessage(msg: string); - procedure WriteMessage(msg: string); - function GetMSIOnlineProductID: Boolean; - public - constructor Create(APack: TKPSFile; ASilent: Boolean; AInstallerMSI: string; AUpdateInstaller, ABuildPackage: Boolean; AOutputFilename, ARedistSetupPath, ALicense, ATitleImage, AAppName: string; AStartDisabled, AStartWithConfiguration: Boolean); // I2562 - procedure Run; - property OnMessage: TCompilePackageMessageEvent read FOnMessage write FOnMessage; - end; - -function DoCompilePackageInstaller(pack: TKPSFile; FMessageEvent: TCompilePackageMessageEvent; FSilent: Boolean; - AInstallerMSI, AOutputFilename, ARedistSetupPath: string; AUpdateInstaller: Boolean; ABuildPackage: Boolean; - ALicense, ATitleImage, AAppName: string; AStartDisabled, AStartWithConfiguration: Boolean): Boolean; // I4598 // I4688 -begin - with TCompilePackageInstaller.Create(pack, FSilent, AInstallerMSI, AUpdateInstaller, ABuildPackage, - AOutputFilename, ARedistSetupPath, ALicense, ATitleImage, AAppName, - AStartDisabled, AStartWithConfiguration) do // I2562 // I4598 // I4688 - try - OnMessage := FMessageEvent; - Run; - Result := True; - finally - Free; - end; -end; - -function DoCompileMSIInstaller(FMessageEvent: TCompilePackageMessageEvent; FSilent: Boolean; AInstallerMSI: string; - AOutputFilename, ARedistSetupPath, ALicense, ATitleImage, AAppName: string; - AStartDisabled, AStartWithConfiguration: Boolean): Boolean; // I2562 -begin - with TCompilePackageInstaller.Create(nil, FSilent, AInstallerMSI, False, False, AOutputFileName, ARedistSetupPath, - ALicense, ATitleImage, AAppName, AStartDisabled, AStartWithConfiguration) do // I2562 - try - OnMessage := FMessageEvent; - Run; - Result := True; - finally - Free; - end; -end; - -{ TCompilePackageInstaller } - -constructor TCompilePackageInstaller.Create(APack: TKPSFile; ASilent: Boolean; AInstallerMSI: string; AUpdateInstaller, ABuildPackage: Boolean; AOutputFileName, ARedistSetupPath, ALicense, ATitleImage, AAppName: string; AStartDisabled, AStartWithConfiguration: Boolean); // I2562 -begin - inherited Create; - FPack := APack; - FSilent := ASilent; - FInstallerMSI := AInstallerMSI; - FUpdateInstaller := AUpdateInstaller; - FBuildPackage := ABuildPackage; - FOutputFilename := AOutputFilename; - FRedistSetupPath := ARedistSetupPath; - FLicense := ALicense; // I2562 - FTitleImage := ATitleImage; - FAppName := AAppName; - FStartDisabled := AStartDisabled; - FStartWithConfiguration := AStartWithConfiguration; - - if (FLicense <> '') and not FileExists(FLicense) then - raise ECompilePackageInstaller.CreateFmt('License file %s could not be found.', [FLicense]); - - if (FTitleImage <> '') and not FileExists(FTitleImage) then - raise ECompilePackageInstaller.CreateFmt('Title iamge file %s could not be found.', [FTitleImage]); - - if not Assigned(FPack) then - begin - if (FInstallerMSI = '') or (FUpdateInstaller) or (FBuildPackage) or (FOutputFilename = '') then - raise ECompilePackageInstaller.Create('Invalid arguments - if Pack is nil then FUpdateInstaller, FBuildPackage must be false and FInstallerMSI and FOutputFilename must not be empty.'); - end - else if FOutputFilename = '' then // I4688 - raise ECompilePackageInstaller.Create('Invalid arguments - if Pack is not nil then FOutputFilename must not be empty.'); -end; - -procedure TCompilePackageInstaller.FatalMessage(msg: string); -begin - FOnMessage(Self, msg, plsFatal); // I4706 -end; - -function TCompilePackageInstaller.GetMSIOnlineProductID: Boolean; -var - hDatabase: MSIHANDLE; - - procedure CheckResult(v: UINT); - begin - if v <> ERROR_SUCCESS then RaiseLastOSError; - end; - - function GetMSIProperty(PropertyName: WideString): WideString; - const - SQLPropertyQuery: WideString = 'SELECT Value FROM Property WHERE Property = ''%0:s'''; - var - hView, hRecord: MSIHANDLE; - buf: array[0..260] of WideChar; - sz: Cardinal; - FResult: Cardinal; - begin - CheckResult(MsiDatabaseOpenViewW(hDatabase, PWideChar(WideFormat(SQLPropertyQuery, [PropertyName])), hView)); - - try - CheckResult(MsiViewExecute(hView, 0)); - try - hRecord := 0; - FResult := MsiViewFetch(hView, hRecord); // I2971 // I3543 - try - case FResult of - ERROR_NO_MORE_ITEMS: - begin - Result := ''; - end; - ERROR_SUCCESS: - begin - sz := 260; - CheckResult(MsiRecordGetStringW(hRecord, 1, buf, sz)); - Result := Copy(buf,1,sz); - end; - else - RaiseLastOSError; - end; - finally - if hRecord <> 0 then MsiCloseHandle(hRecord); // I2971 // I3543 - end; - finally - MsiViewClose(hView); - end; - finally - MsiCloseHandle(hView); // I2971 // I3543 - end; - end; - -begin - Result := False; - CheckResult(MsiOpenDatabaseW(PWideChar(FInstallerMSI), nil, hDatabase)); - - try - FVersion := GetMSIProperty('ProductVersion'); - if FVersion = '' then - begin - FatalMessage('No ProductVersion found in the MSI file.'); - Exit; - end; - - FProductName := GetMSIProperty('ProductName'); - if FProductName = '' then - begin - FatalMessage('No ProductName found in the MSI file.'); - Exit; - end; - - Result := True; - finally - MsiCloseHandle(hDatabase); - end; -end; - -procedure TCompilePackageInstaller.Run; -var - FDestFileName: WideString; - fs: TFileStream; - s: WideString; - i: Integer; - FMSIOptions: WideString; - FRedistSetupFile, FPackageOutputFileName: string; // I3126 -begin - { Check that the .msi is setup for the package } - - FTempPath := CreateTempPath; - try - try - if Assigned(FPack) then - begin - if (FPack.FileName = '') and FBuildPackage then - begin - FatalMessage('You need to save the package before building.'); - Exit; - end; - - WriteMessage('Compiling package ' + ExtractFileName(FPack.FileName) + '...'); - - if FPack.Info.Desc['Name'] = '' then - begin - FatalMessage('You need to fill in the package name before building.'); - Exit; - end; - - if FInstallerMSI <> '' then - FPack.KPSOptions.MSIFileName := ExpandFileName(FInstallerMSI); - - FInstallerMSI := FPack.KPSOptions.MSIFileName; - FMSIOptions := FPack.KPSOptions.MSIOptions; // I3126 - -// FOutputFileName := FPack.InstallerFileName; - end - else - begin - WriteMessage('Compiling installer '+ExtractFileName(FOutputFileName)+'...'); - FInstallerMSI := ExpandFileName(FInstallerMSI); - FMSIOptions := ''; // I3126 - end; - - if not FileExists(FInstallerMSI) then - begin - FatalMessage('The installer could not be built because the MSI file was missing.'); - Exit; - end; - - if (FInstallerMSI <> '') and FUpdateInstaller and Assigned(FPack) then - FPack.SaveXML; - - if FRedistSetupPath = '' then - begin - FRedistSetupPath := GetRedistSetupPath; - WriteMessage('Redist path not specified, loading default ('+FRedistSetupPath+')'); - end; - - if not FileExists(FRedistSetupPath + 'setup.exe') and - not FileExists(FRedistSetupPath + 'setup-redist.exe') then - begin - FatalMessage('Neither setup.exe nor setup-redist.exe are present in redist ('+FRedistSetupPath+').'); - Exit; - end; - - { Check the product ID for the package } - if not GetMSIOnlineProductID then Exit; - - { TODO: if the package consists of *only* kmp files, then just add those to the installer } - - { Build the package } - if Assigned(FPack) then - begin - FPackageOutputFileName := ExtractFilePath(FOutputFilename) + ChangeFileExt(ExtractFileName(FPack.FileName), '.kmp'); // I4741 - if FBuildPackage then - begin - if not DoCompilePackage(FPack, FOnMessage, True, False, FPackageOutputFileName) then Exit; - end - else if not FileExists(FPackageOutputFileName) then - begin - FatalMessage('The package file '+FPackageOutputFileName+' does not exist'); - Exit; - end; - - { Test if the keyboards in the package need to be encrypted for the installer } - - FDestFileName := FPackageOutputFileName; - end - else - FDestFileName := ''; - - { Build setup.inf } - with TStringList.Create do - try - s := '[Setup]'#13#10 + - 'Version=' + FVersion + #13#10 + - 'MSIFileName='+ExtractFileName(FInstallerMSI) + #13#10 + - 'MSIOptions='+FMSIOptions + #13#10; // I3126 - - if FAppName <> '' then - s := s + 'AppName='+FAppName + #13#10; - - if FLicense <> '' then // I2562 - s := s + 'License='+ExtractFileName(FLicense) + #13#10; - - if FTitleImage <> '' then - s := s + 'TitleImage='+ExtractFileName(FTitleImage) + #13#10; - - - if Assigned(FPack) and (FPack.KPSOptions.GraphicFile <> nil) and - SameText(ExtractFileExt(FPack.KPSOptions.GraphicFile.FileName), '.bmp') then - begin - s := s + 'BitmapFileName='+ExtractFileName(FPack.KPSOptions.GraphicFile.FileName); - end; - - if FStartDisabled then - s := s + 'StartDisabled=True'#13#10; - - if FStartWithConfiguration then - s := s + 'StartWithConfiguration=True'#13#10; - - s := s + #13#10 + - '[Packages]'#13#10; - - if Assigned(FPack) then - s := s + ExtractFileName(FDestFileName)+'='+FPack.Info.Desc[PackageInfo_Name]; - - { Iterate through the strings } - - if Assigned(FPack) then - begin - s := s + #13#10#13#10'[Strings]'#13#10; - for i := 0 to FPack.Strings.Count - 1 do - s := s + FPack.Strings[i] + #13#10; - end; - - Text := s; - - SaveToFile(FTempPath + '\setup.inf', TEncoding.UTF8); // We want UTF-8 so Title can be Unicode // I3337 - finally - Free; - end; - - { Build zip file } - - try - with TZipFile.Create do - try - Open(FTempPath + '\setup.zip', TZipMode.zmWrite); - Add(FTempPath + '\setup.inf'); - Add(FInstallerMSI); - if FLicense <> '' then Add(FLicense); // I2562 - if FTitleImage <> '' then Add(FTitleImage); - if Assigned(FPack) and (FPack.KPSOptions.GraphicFile <> nil) and - SameText(ExtractFileExt(FPack.KPSOptions.GraphicFile.FileName), '.bmp') then - Add(FPack.KPSOptions.GraphicFile.FileName); - if FDestFileName <> '' then Add(FDestFileName); - Close; - finally - Free; - end; - except - on E:EZipException do - begin - FatalMessage(E.Message); - Exit; - end; - end; - - { Create the self-extracting archive } - - with TFileStream.Create(FOutputFileName, fmCreate) do - try - // A separate version of setup.exe which doesn't include a digital signature - // is included here, so that it can be bundled with a zip and the result signed. - if FileExists(FRedistSetupPath + 'setup-redist.exe') - then FRedistSetupFile := FRedistSetupPath + 'setup-redist.exe' - else FRedistSetupFile := FRedistSetupPath + 'setup.exe'; - fs := TFileStream.Create(FRedistSetupFile, fmOpenRead or fmShareDenyWrite); - try - CopyFrom(fs, 0); - finally - fs.Free; - end; - - fs := TFileStream.Create(FTempPath + '\setup.zip', fmOpenRead or fmShareDenyWrite); - try - CopyFrom(fs, 0); - finally - fs.Free; - end; - finally - Free; - end; - except - on E:EOSError do - FatalMessage(E.Message); - end; - finally - DeleteTempPath(FTempPath); - end; -end; - -procedure TCompilePackageInstaller.WriteMessage(msg: string); -begin - FOnMessage(Self, msg, plsInfo); // I4706 -end; - -end. diff --git a/developer/src/test/auto/keyboard-package-versions/test-1.0/test-1.0.kpj b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test-1.0.kpj similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-1.0/test-1.0.kpj rename to developer/src/kmc-package/test/fixtures/versioning/test-1.0/test-1.0.kpj diff --git a/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.js b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.js new file mode 100644 index 00000000000..9ee538d9ae4 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.js @@ -0,0 +1 @@ +KeymanWeb.KR(new Keyboard_test());function Keyboard_test(){this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;this.KI="Keyboard_test";this.KN="Keyboard Version Test";this.KMINVER="9.0";this.KV=null;this.KDU=0;this.KH='';this.KM=0;this.KBVER="1.0";this.KMBM=0x0;this.KVER="17.0.159.0";this.KVS=[];this.gs=function(t,e) {return this.g0(t,e);};this.gs=function(t,e) {return this.g0(t,e);};this.g0=function(t,e) {var k=KeymanWeb,r=0,m=0;return r;};} \ No newline at end of file diff --git a/developer/src/test/auto/keyboard-package-versions/test-1.0/test.kmn b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.kmn similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-1.0/test.kmn rename to developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.kmn diff --git a/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.kmx b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.kmx new file mode 100644 index 00000000000..9e4bd15d391 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/versioning/test-1.0/test.kmx differ diff --git a/developer/src/test/auto/keyboard-package-versions/test-2.0/test-2.0.kpj b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test-2.0.kpj similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-2.0/test-2.0.kpj rename to developer/src/kmc-package/test/fixtures/versioning/test-2.0/test-2.0.kpj diff --git a/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.js b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.js new file mode 100644 index 00000000000..788a3d58ffa --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.js @@ -0,0 +1 @@ +KeymanWeb.KR(new Keyboard_test());function Keyboard_test(){this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;this.KI="Keyboard_test";this.KN="Keyboard Version Test";this.KMINVER="9.0";this.KV=null;this.KDU=0;this.KH='';this.KM=0;this.KBVER="2.0";this.KMBM=0x0;this.KVER="17.0.159.0";this.KVS=[];this.gs=function(t,e) {return this.g0(t,e);};this.gs=function(t,e) {return this.g0(t,e);};this.g0=function(t,e) {var k=KeymanWeb,r=0,m=0;return r;};} \ No newline at end of file diff --git a/developer/src/test/auto/keyboard-package-versions/test-2.0/test.kmn b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.kmn similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-2.0/test.kmn rename to developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.kmn diff --git a/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.kmx b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.kmx new file mode 100644 index 00000000000..0efeffe9743 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/versioning/test-2.0/test.kmx differ diff --git a/developer/src/test/auto/keyboard-package-versions/test-keyboard-1-vs-package-2.kps b/developer/src/kmc-package/test/fixtures/versioning/test-keyboard-1-vs-package-2.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-keyboard-1-vs-package-2.kps rename to developer/src/kmc-package/test/fixtures/versioning/test-keyboard-1-vs-package-2.kps diff --git a/developer/src/test/auto/keyboard-package-versions/test-package-1-vs-keyboard-2.kps b/developer/src/kmc-package/test/fixtures/versioning/test-package-1-vs-keyboard-2.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test-package-1-vs-keyboard-2.kps rename to developer/src/kmc-package/test/fixtures/versioning/test-package-1-vs-keyboard-2.kps diff --git a/developer/src/test/auto/keyboard-package-versions/test1-2.kps b/developer/src/kmc-package/test/fixtures/versioning/test1-2.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test1-2.kps rename to developer/src/kmc-package/test/fixtures/versioning/test1-2.kps diff --git a/developer/src/test/auto/keyboard-package-versions/test1.kps b/developer/src/kmc-package/test/fixtures/versioning/test1.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test1.kps rename to developer/src/kmc-package/test/fixtures/versioning/test1.kps diff --git a/developer/src/test/auto/keyboard-package-versions/test2-1.kps b/developer/src/kmc-package/test/fixtures/versioning/test2-1.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test2-1.kps rename to developer/src/kmc-package/test/fixtures/versioning/test2-1.kps diff --git a/developer/src/test/auto/keyboard-package-versions/test2.kps b/developer/src/kmc-package/test/fixtures/versioning/test2.kps similarity index 100% rename from developer/src/test/auto/keyboard-package-versions/test2.kps rename to developer/src/kmc-package/test/fixtures/versioning/test2.kps diff --git a/developer/src/kmc-package/test/test-versioning.ts b/developer/src/kmc-package/test/test-versioning.ts new file mode 100644 index 00000000000..e9771a369ab --- /dev/null +++ b/developer/src/kmc-package/test/test-versioning.ts @@ -0,0 +1,42 @@ +import 'mocha'; +import { assert } from 'chai'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; +import { makePathToFixture } from './helpers/index.js'; +import { KmpCompiler } from '../src/compiler/kmp-compiler.js'; +import { KmpJsonFile } from '@keymanapp/common-types'; + +// This unit test was translated from a Delphi test +// Keyman.Test.System.CompilePackageVersioningTest, but note the difference in +// test results documented below. + +describe('package versioning', function () { + + const cases: [string,string][] = [ + ['test-single-version-1-package', 'test1.kps'], + ['test-single-version-2-package', 'test2.kps'], + + // The test result for the following two packages has changed in Keyman 17, + // in commit 92c8c6497e987a0583c62c91515884e6e36ece23, to 'shouldPass': + // + // `WARN_KeyboardVersionsDoNotMatchPackageVersion` has been removed, because + // it did not really make sense; if 'FollowKeyboardVersion' is set, it could + // not be raised, and otherwise, the author may wish to have separate + // keyboard + package versions anyway. + + ['test-version-2-1-mismatch', 'test2-1.kps'], + ['test-version-1-2-mismatch', 'test1-2.kps'], + + ['test-keyboard-1-package-2', 'test-keyboard-1-vs-package-2.kps'], + ['test-package-1-keyboard-2', 'test-package-1-vs-keyboard-2.kps'], + ]; + + for(const [ caseTitle, filename ] of cases) { + it(caseTitle, async function () { + const callbacks = new TestCompilerCallbacks(); + const kmpCompiler = new KmpCompiler(callbacks); + const kpsPath = makePathToFixture('versioning', filename); + const kmpJson: KmpJsonFile.KmpJsonFile = kmpCompiler.transformKpsToKmpObject(kpsPath); + assert.isTrue(kmpJson !== null); + }); + } +}); diff --git a/developer/src/test/auto/Makefile b/developer/src/test/auto/Makefile index 68108dde1fe..8f815f3b7b7 100644 --- a/developer/src/test/auto/Makefile +++ b/developer/src/test/auto/Makefile @@ -16,7 +16,6 @@ test: developer-tests: \ compile-supplementary-support \ keyboard-js-info \ - keyboard-package-versions \ kmcomp \ kmcomp-x64-structures \ kmconvert \ @@ -44,10 +43,6 @@ kmx-file-languages: .virtual cd $(DEVELOPER_ROOT)\src\test\auto\kmx-file-languages $(MAKE) $(TARGET) -keyboard-package-versions: .virtual - cd $(DEVELOPER_ROOT)\src\test\auto\keyboard-package-versions - $(MAKE) $(TARGET) - kmcomp: .virtual cd $(DEVELOPER_ROOT)\src\test\auto\kmcomp $(MAKE) $(TARGET) diff --git a/developer/src/test/auto/developer-test-auto.groupproj b/developer/src/test/auto/developer-test-auto.groupproj index cf31a8f8ced..b680dfb6aec 100644 --- a/developer/src/test/auto/developer-test-auto.groupproj +++ b/developer/src/test/auto/developer-test-auto.groupproj @@ -6,9 +6,6 @@ - - - @@ -41,15 +38,6 @@ - - - - - - - - - @@ -96,13 +84,13 @@ - + - + - + diff --git a/developer/src/test/auto/keyboard-package-versions/.gitignore b/developer/src/test/auto/keyboard-package-versions/.gitignore deleted file mode 100644 index 09bf1459b58..00000000000 --- a/developer/src/test/auto/keyboard-package-versions/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.kmp -test-?.0/*.js -test-?.0/*.kmx diff --git a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr deleted file mode 100644 index d3645dc38f6..00000000000 --- a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr +++ /dev/null @@ -1,142 +0,0 @@ -program KeyboardPackageVersionsTestSuite; - -{$IFNDEF TESTINSIGHT} -{$APPTYPE CONSOLE} -{$ENDIF}{$STRONGLINKTYPES ON} -uses - System.SysUtils, - {$IFDEF TESTINSIGHT} - TestInsight.DUnitX, - {$ENDIF } - DUnitX.Loggers.Console, - DUnitX.Loggers.Xml.NUnit, - DUnitX.TestFramework, - Keyman.Test.System.CompilePackageVersioningTest in 'Keyman.Test.System.CompilePackageVersioningTest.pas', - CompilePackage in '..\..\..\common\delphi\compiler\CompilePackage.pas', - VisualKeyboard in '..\..\..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboard.pas', - kmpinffile in '..\..\..\..\..\common\windows\delphi\packages\kmpinffile.pas', - kpsfile in '..\..\..\common\delphi\packages\kpsfile.pas', - PackageFileFormats in '..\..\..\..\..\common\windows\delphi\packages\PackageFileFormats.pas', - PackageInfo in '..\..\..\..\..\common\windows\delphi\packages\PackageInfo.pas', - utilfiletypes in '..\..\..\..\..\common\windows\delphi\general\utilfiletypes.pas', - StockFileNames in '..\..\..\..\..\common\windows\delphi\general\StockFileNames.pas', - utilstr in '..\..\..\..\..\common\windows\delphi\general\utilstr.pas', - Unicode in '..\..\..\..\..\common\windows\delphi\general\Unicode.pas', - JsonUtil in '..\..\..\..\..\common\windows\delphi\general\JsonUtil.pas', - KeymanVersion in '..\..\..\..\..\common\windows\delphi\general\KeymanVersion.pas', - utildir in '..\..\..\..\..\common\windows\delphi\general\utildir.pas', - utilsystem in '..\..\..\..\..\common\windows\delphi\general\utilsystem.pas', - RegistryKeys in '..\..\..\..\..\common\windows\delphi\general\RegistryKeys.pas', - utilexecute in '..\..\..\..\..\common\windows\delphi\general\utilexecute.pas', - GetOsVersion in '..\..\..\..\..\common\windows\delphi\general\GetOsVersion.pas', - VersionInfo in '..\..\..\..\..\common\windows\delphi\general\VersionInfo.pas', - ExtShiftState in '..\..\..\..\..\common\windows\delphi\visualkeyboard\ExtShiftState.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', - VKeyChars in '..\..\..\..\..\common\windows\delphi\general\VKeyChars.pas', - VKeys in '..\..\..\..\..\common\windows\delphi\general\VKeys.pas', - ErrorControlledRegistry in '..\..\..\..\..\common\windows\delphi\vcl\ErrorControlledRegistry.pas', - kmxfile in '..\..\..\..\..\common\windows\delphi\keyboards\kmxfile.pas', - KeyNames in '..\..\..\..\..\common\windows\delphi\general\KeyNames.pas', - KeymanDeveloperOptions in '..\..\..\tike\main\KeymanDeveloperOptions.pas', - Keyman.System.PackageInfoRefreshKeyboards in '..\..\..\common\delphi\packages\Keyman.System.PackageInfoRefreshKeyboards.pas', - Keyman.System.KeyboardJSInfo in '..\..\..\common\delphi\keyboards\Keyman.System.KeyboardJSInfo.pas', - Keyman.System.KeyboardUtils in '..\..\..\common\delphi\keyboards\Keyman.System.KeyboardUtils.pas', - Keyman.System.KMXFileLanguages in '..\..\..\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', - TempFileManager in '..\..\..\..\..\common\windows\delphi\general\TempFileManager.pas', - RedistFiles in '..\..\..\tike\main\RedistFiles.pas', - DebugPaths in '..\..\..\..\..\common\windows\delphi\general\DebugPaths.pas', - Upload_Settings in '..\..\..\..\..\common\windows\delphi\general\Upload_Settings.pas', - klog in '..\..\..\..\..\common\windows\delphi\general\klog.pas', - compile in '..\..\..\common\delphi\compiler\compile.pas', - Keyman.Developer.System.Project.kmnProjectFile in '..\..\..\tike\project\Keyman.Developer.System.Project.kmnProjectFile.pas', - Keyman.Developer.System.Project.kmnProjectFileAction in '..\..\..\tike\project\Keyman.Developer.System.Project.kmnProjectFileAction.pas', - Keyman.Developer.System.Project.Project in '..\..\..\tike\project\Keyman.Developer.System.Project.Project.pas', - Keyman.Developer.System.Project.ProjectFile in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectFile.pas', - Keyman.Developer.System.Project.ProjectFiles in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectFiles.pas', - Keyman.Developer.System.Project.ProjectFileType in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectFileType.pas', - mrulist in '..\..\..\tike\main\mrulist.pas', - kmxfileconsts in '..\..\..\..\..\common\windows\delphi\keyboards\kmxfileconsts.pas', - Keyman.Developer.System.Project.ProjectLoader in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectLoader.pas', - Keyman.Developer.System.Project.ProjectLog in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectLog.pas', - Keyman.Developer.System.Project.ProjectSaver in '..\..\..\tike\project\Keyman.Developer.System.Project.ProjectSaver.pas', - UKeymanTargets in '..\..\..\common\delphi\general\UKeymanTargets.pas', - CompileErrorCodes in '..\..\..\common\delphi\compiler\CompileErrorCodes.pas', - KeyboardParser in '..\..\..\tike\main\KeyboardParser.pas', - WindowsLanguages in '..\..\..\common\delphi\general\WindowsLanguages.pas', - KeymanWebKeyCodes in '..\..\..\tike\compile\KeymanWebKeyCodes.pas', - kmxfileutils in '..\..\..\..\..\common\windows\delphi\keyboards\kmxfileutils.pas', - TouchLayoutDefinitions in '..\..\..\tike\oskbuilder\TouchLayoutDefinitions.pas', - TouchLayout in '..\..\..\tike\oskbuilder\TouchLayout.pas', - KeyboardFonts in '..\..\..\common\delphi\general\KeyboardFonts.pas', - Keyman.Developer.System.Project.kpsProjectFile in '..\..\..\tike\project\Keyman.Developer.System.Project.kpsProjectFile.pas', - Keyman.Developer.System.Project.kpsProjectFileAction in '..\..\..\tike\project\Keyman.Developer.System.Project.kpsProjectFileAction.pas', - CompilePackageInstaller in '..\..\..\common\delphi\compiler\CompilePackageInstaller.pas', - utilhttp in '..\..\..\..\..\common\windows\delphi\general\utilhttp.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', - DUnitX.Loggers.TeamCity in '..\..\..\..\..\common\windows\delphi\general\DUnitX.Loggers.TeamCity.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', - TextFileFormat in '..\..\..\common\delphi\general\TextFileFormat.pas', - Keyman.System.LexicalModelUtils in '..\..\..\common\delphi\lexicalmodels\Keyman.System.LexicalModelUtils.pas', - Keyman.System.PackageInfoRefreshLexicalModels in '..\..\..\common\delphi\packages\Keyman.System.PackageInfoRefreshLexicalModels.pas', - Keyman.System.Standards.LangTagsRegistry in '..\..\..\..\..\common\windows\delphi\standards\Keyman.System.Standards.LangTagsRegistry.pas', - Keyman.Developer.System.Project.UrlRenderer in '..\..\..\tike\project\Keyman.Developer.System.Project.UrlRenderer.pas', - KeymanPaths in '..\..\..\..\..\common\windows\delphi\general\KeymanPaths.pas', - Keyman.Developer.System.ValidateKpsFile in '..\..\..\common\delphi\compiler\Keyman.Developer.System.ValidateKpsFile.pas', - Keyman.Developer.System.KeymanDeveloperPaths in '..\..\..\tike\main\Keyman.Developer.System.KeymanDeveloperPaths.pas', - Keyman.Developer.System.KmcWrapper in '..\..\..\tike\compile\Keyman.Developer.System.KmcWrapper.pas'; - -var - runner : ITestRunner; - results : IRunResults; - logger : ITestLogger; - nunitLogger : ITestLogger; -begin -{$IFDEF TESTINSIGHT} - TestInsight.DUnitX.RunRegisteredTests; - exit; -{$ENDIF} - try - //Check command line options, will exit if invalid - TDUnitX.CheckCommandLine; - //Create the test runner - runner := TDUnitX.CreateRunner; - //Tell the runner to use RTTI to find Fixtures - runner.UseRTTI := True; - //tell the runner how we will log things - //Log to the console window - logger := TDUnitXConsoleLogger.Create(true); - runner.AddLogger(logger); - //Generate an NUnit compatible XML File - nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile); - runner.AddLogger(nunitLogger); - runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests; - - //Run tests - results := runner.Execute; - if not results.AllPassed then - System.ExitCode := EXIT_ERRORS; - - {$IFNDEF CI} - //We don't want this happening when running under CI. - if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then - begin - System.Write('Done.. press key to quit.'); - System.Readln; - end; - {$ENDIF} - - DUnitX.Loggers.TeamCity.ReportToTeamCity; - except - on E: Exception do - System.Writeln(E.ClassName, ': ', E.Message); - end; -end. diff --git a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj deleted file mode 100644 index 1ebd5a77344..00000000000 --- a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj +++ /dev/null @@ -1,1034 +0,0 @@ - - - {7A8E88E4-B407-442B-9A53-DE6F43F1C0F1} - 18.8 - VCL - KeyboardPackageVersionsTestSuite.dpr - True - Debug - Win32 - 1 - Console - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_1 - true - true - - - true - Base - true - - - .\obj\$(Platform)\$(Config) - .\bin\$(Platform)\$(Config) - false - false - false - false - false - RESTComponents;FireDAC;FireDACSqliteDriver;soaprtl;FireDACIBDriver;soapmidas;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;$(DCC_UsePackage) - System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) - true - $(BDS)\bin\delphi_PROJECTICON.ico - $(BDS)\bin\delphi_PROJECTICNS.icns - $(DUnitX);$(DCC_UnitSearchPath) - KeyboardPackageVersionsTestSuite - $(CI);$(DCC_Define) - 3081 - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= - - - DBXSqliteDriver;bindcompdbx;IndyIPCommon;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;svnui;mbColorLibD10;dsnapcon;FireDACADSDriver;scFontCombo;DCPdelphi2009;FireDACMSAccDriver;fmxFireDAC;vclimg;Jcl;vcltouch;JvCore;vcldb;bindcompfmx;svn;FireDACPgDriver;inetdb;DbxCommonDriver;fmx;fmxdae;xmlrtl;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;IndyIPClient;bindcompvcl;EmbeddedWebBrowser_XE;VCLRESTComponents;dbxcds;VclSmp;JvDocking;adortl;JclVcl;vclie;bindengine;DBXMySQLDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;IndyProtocols;keyman_components;FireDACCommonODBC;fmxase;$(DCC_UsePackage) - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - Debug - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= - 1033 - - - DBXSqliteDriver;bindcompdbx;IndyIPCommon;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;Jcl;vcltouch;vcldb;bindcompfmx;FireDACPgDriver;inetdb;DbxCommonDriver;fmx;fmxdae;xmlrtl;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;IndyIPClient;bindcompvcl;VCLRESTComponents;dbxcds;VclSmp;adortl;JclVcl;vclie;bindengine;DBXMySQLDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;IndyProtocols;FireDACCommonODBC;fmxase;$(DCC_UsePackage) - - - DEBUG;$(DCC_Define) - true - false - true - true - true - - - false - -l:Information - 1033 - (None) - - - false - RELEASE;$(DCC_Define) - 0 - 0 - - - - MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - Console - - - - KeyboardPackageVersionsTestSuite.dpr - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - - - true - - - - - true - - - - - true - - - - - true - - - - - KeyboardPackageVersionsTestSuite.exe - true - - - - - 1 - - - 0 - - - - - classes - 1 - - - classes - 1 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - 1 - - - 0 - - - - - 1 - .framework - - - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - - - - 1 - - - 1 - - - 1 - - - - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - - - True - False - - - 12 - - - - - diff --git a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.res b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.res deleted file mode 100644 index 6876088a664..00000000000 Binary files a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.res and /dev/null differ diff --git a/developer/src/test/auto/keyboard-package-versions/Keyman.Test.System.CompilePackageVersioningTest.pas b/developer/src/test/auto/keyboard-package-versions/Keyman.Test.System.CompilePackageVersioningTest.pas deleted file mode 100644 index 8fd0c993f79..00000000000 --- a/developer/src/test/auto/keyboard-package-versions/Keyman.Test.System.CompilePackageVersioningTest.pas +++ /dev/null @@ -1,155 +0,0 @@ -unit Keyman.Test.System.CompilePackageVersioningTest; - -interface - -uses - DUnitX.TestFramework, - Keyman.Developer.System.Project.ProjectLog; - -type - - [TestFixture] - TCompilePackageVersioningTest = class(TObject) - private - FRoot: string; - procedure PackageMessage(Sender: TObject; msg: string; - State: TProjectLogState); - public - [Setup] - procedure Setup; - [TearDown] - procedure TearDown; - // Sample Methods - // Simple single Test - // Test with TestCase Attribute to supply parameters. - [Test] - [TestCase('test-single-version-1-package', 'test1.kps,False')] - [TestCase('test-single-version-2-package', 'test2.kps,False')] - [TestCase('test-version-2-1-mismatch', 'test2-1.kps,True')] - [TestCase('test-version-1-2-mismatch', 'test1-2.kps,True')] - [TestCase('test-keyboard-1-package-2', 'test-keyboard-1-vs-package-2.kps,False')] - [TestCase('test-package-1-keyboard-2', 'test-package-1-vs-keyboard-2.kps,False')] - procedure TestPackageCompile(Path: string; ExpectError: Boolean); - end; - -implementation - -uses - System.SysUtils, - Winapi.ActiveX, - - compile, - CompilePackage, - Keyman.Developer.System.Project.kmnProjectFileAction, - Keyman.Developer.System.Project.ProjectFile, - kpsfile; - -type - TProjectConsole = class(TProject) - private - FSilent: Boolean; - FFullySilent: Boolean; - public - procedure Log(AState: TProjectLogState; Filename: string; Msg: string; MsgCode, line: Integer); override; // I4706 - function Save: Boolean; override; // I4709 - - property Silent: Boolean read FSilent write FSilent; - property FullySilent: Boolean read FFullySilent write FFullySilent; - end; - -procedure TCompilePackageVersioningTest.Setup; -var - p: TProjectConsole; - i: Integer; -begin - Assert.IgnoreCaseDefault := False; - - FRoot := ExtractFileDir(ExtractFileDir(ExtractFileDir(ExtractFileDir(ParamStr(0))))); - - p := TProjectConsole.Create(ptUnknown, FRoot+'\test-1.0\test-1.0.kpj', False); - try - for i := 0 to p.Files.Count - 1 do - if p.Files[i] is TkmnProjectFileAction then - Assert.IsTrue((p.Files[i] as TkmnProjectFileAction).CompileKeyboard, 'Could not compile keyboard'); - finally - p.Free; - end; - - p := TProjectConsole.Create(ptUnknown, FRoot+'\test-2.0\test-2.0.kpj', False); - try - for i := 0 to p.Files.Count - 1 do - if p.Files[i] is TkmnProjectFileAction then - Assert.IsTrue((p.Files[i] as TkmnProjectFileAction).CompileKeyboard, 'Could not compile keyboard'); - finally - p.Free; - end; -end; - -procedure TCompilePackageVersioningTest.TearDown; -begin -end; - -procedure TCompilePackageVersioningTest.PackageMessage(Sender: TObject; msg: string; State: TProjectLogState); -const - Map: array[TProjectLogState] of TLogLevel = ( - {plsInfo} TLogLevel.Information, - {plsHint} TLogLevel.Information, - {plsWarning} TLogLevel.Warning, - {plsError} TLogLevel.Error, - {plsFatal} TLogLevel.Error, - {plsSuccess} TLogLevel.Information, - {plsFailure} TLogLevel.Error - ); -begin - Log(Map[State], msg); -end; - -procedure TCompilePackageVersioningTest.TestPackageCompile(Path: string; ExpectError: Boolean); -var - pack: TKPSFile; - res: Boolean; -begin - pack := TKPSFile.Create; - try - pack.FileName := FRoot+'\'+Path; - pack.LoadXML; - res := DoCompilePackage(pack, PackageMessage, False, False, FRoot+'\'+ChangeFileExt(Path,'.kmp')); - Assert.AreEqual(not ExpectError, res); - finally - pack.Free; - end; -end; - -procedure TProjectConsole.Log(AState: TProjectLogState; Filename, Msg: string; MsgCode, line: Integer); // I4706 -begin -{$IFDEF DEBUG_PROJECT} - case AState of - plsInfo, - plsSuccess, - plsFailure: - if not FSilent then - writeln(ExtractFileName(Filename)+': '+Msg); - plsWarning: - if not FFullySilent then - writeln(ExtractFileName(Filename)+': Warning: '+Msg); - plsError: - if not FFullySilent then - writeln(ExtractFileName(Filename)+': Error: '+Msg); - plsFatal: - writeln(ExtractFileName(Filename)+': Fatal error: '+Msg); - end; -{$ENDIF} -end; - -function TProjectConsole.Save: Boolean; // I4709 -begin - // We don't modify the project file in the console - Result := True; -end; - -initialization - CoInitializeEx(nil, COINIT_APARTMENTTHREADED); - TDUnitX.RegisterTestFixture(TCompilePackageVersioningTest); -finalization - CoUninitialize; -end. diff --git a/developer/src/test/auto/keyboard-package-versions/Makefile b/developer/src/test/auto/keyboard-package-versions/Makefile deleted file mode 100644 index c07f744018f..00000000000 --- a/developer/src/test/auto/keyboard-package-versions/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# -# Test that package compiler manages keyboard and package versions correctly -# -# NOTE: The .dproj needs $(CI) added to the Delphi Compiler/Conditional defines (All -# configurations - all platforms) section in order for the CI flag to be passed in. -# (It's best to make this change in Delphi IDE). -# - -!include ..\..\..\Defines.mak - -test: build - $(WIN32_TARGET_PATH)\keyboardpackageversionstestsuite.exe -b -exit:continue - -build: - $(DELPHI_MSBUILD) "/p:CI=CI" keyboardpackageversionstestsuite.dproj - -clean: def-clean - -del *.kmp - -del test-1.0\*.kmx - -del test-2.0\*.kmx - -del test-1.0\*.js - -del test-2.0\*.js - -!include ..\..\..\Target.mak diff --git a/developer/src/tike/child/UfrmPackageEditor.dfm b/developer/src/tike/child/UfrmPackageEditor.dfm index 4c6967d4618..07567cfa6fd 100644 --- a/developer/src/tike/child/UfrmPackageEditor.dfm +++ b/developer/src/tike/child/UfrmPackageEditor.dfm @@ -1134,7 +1134,6 @@ inherited frmPackageEditor: TfrmPackageEditor Anchors = [akLeft, akTop, akRight] TabOrder = 2 OnClick = cbLicenseClick - ExplicitWidth = 482 end end end @@ -1351,7 +1350,7 @@ inherited frmPackageEditor: TfrmPackageEditor BevelOuter = bvNone Color = 15921906 ParentBackground = False - TabOrder = 4 + TabOrder = 3 object lblDebugHostCaption: TLabel Left = 12 Top = 70 @@ -1438,7 +1437,7 @@ inherited frmPackageEditor: TfrmPackageEditor Left = 15 Top = 274 Width = 295 - Height = 124 + Height = 276 BevelOuter = bvNone Color = 15921906 ParentBackground = False @@ -1484,74 +1483,6 @@ inherited frmPackageEditor: TfrmPackageEditor OnClick = cmdUninstallClick end end - object panBuildWindowsInstaller: TPanel - Left = 15 - Top = 418 - Width = 295 - Height = 132 - BevelOuter = bvNone - Color = 15921906 - ParentBackground = False - TabOrder = 3 - object Label9: TLabel - Left = 9 - Top = 6 - Width = 124 - Height = 17 - Caption = 'Windows Installer' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -14 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - ParentFont = False - end - object lblBootstrapMSI: TLabel - Left = 9 - Top = 69 - Width = 64 - Height = 13 - Caption = 'Keyman MSI:' - FocusControl = editBootstrapMSI - end - object lblInstallerOutputFilename: TLabel - Left = 9 - Top = 37 - Width = 82 - Height = 13 - Caption = 'Target filename:' - FocusControl = editInstallerOutputFilename - end - object editBootstrapMSI: TEdit - Left = 125 - Top = 66 - Width = 156 - Height = 21 - TabStop = False - ParentColor = True - ReadOnly = True - TabOrder = 1 - end - object editInstallerOutputFilename: TEdit - Left = 125 - Top = 34 - Width = 156 - Height = 21 - TabStop = False - ParentColor = True - ReadOnly = True - TabOrder = 0 - end - object cmdInstallWith: TButton - Left = 125 - Top = 96 - Width = 156 - Height = 25 - Caption = 'Find Keyman MSI...' - TabOrder = 2 - OnClick = cmdInstallWithClick - end - end object panOpenInExplorer: TPanel Left = 15 Top = 187 @@ -1641,22 +1572,13 @@ inherited frmPackageEditor: TfrmPackageEditor ReadOnly = True TabOrder = 0 end - object cmdCompileInstaller: TButton - Left = 148 - Top = 32 - Width = 133 - Height = 25 - Caption = 'Compile I&nstaller' - TabOrder = 1 - OnClick = cmdCompileInstallerClick - end object cmdAddToProject: TButton - Left = 287 + Left = 148 Top = 32 Width = 133 Height = 25 Action = modActionsMain.actProjectAddCurrentEditorFile - TabOrder = 2 + TabOrder = 1 end object cmdBuildPackage: TButton Left = 9 @@ -1664,7 +1586,7 @@ inherited frmPackageEditor: TfrmPackageEditor Width = 133 Height = 25 Caption = 'Compile &Package' - TabOrder = 3 + TabOrder = 2 OnClick = cmdBuildPackageClick end end @@ -1685,12 +1607,4 @@ inherited frmPackageEditor: TfrmPackageEditor Left = 32 Top = 532 end - object dlgOpenProductInstaller: TOpenDialog - DefaultExt = 'msi' - Filter = 'Product Installer Files (*.msi)|*.msi|All Files (*.*)|*.*' - Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing] - Title = 'Select Product Installer' - Left = 32 - Top = 456 - end end diff --git a/developer/src/tike/child/UfrmPackageEditor.pas b/developer/src/tike/child/UfrmPackageEditor.pas index d11cee99abe..7d4faabe90c 100644 --- a/developer/src/tike/child/UfrmPackageEditor.pas +++ b/developer/src/tike/child/UfrmPackageEditor.pas @@ -69,7 +69,6 @@ interface TfrmPackageEditor = class(TfrmTikeEditor) // I4689 dlgFiles: TOpenDialog; dlgNewCustomisation: TSaveDialog; - dlgOpenProductInstaller: TOpenDialog; pages: TLeftTabbedPageControl; pageFiles: TTabSheet; pageDetails: TTabSheet; @@ -169,13 +168,6 @@ TfrmPackageEditor = class(TfrmTikeEditor) // I4689 lblCompileTargetHeader: TLabel; cmdInstall: TButton; cmdUninstall: TButton; - panBuildWindowsInstaller: TPanel; - Label9: TLabel; - lblBootstrapMSI: TLabel; - lblInstallerOutputFilename: TLabel; - editBootstrapMSI: TEdit; - editInstallerOutputFilename: TEdit; - cmdInstallWith: TButton; pageLexicalModels: TTabSheet; panLexicalModels: TPanel; lblLexlicalModels: TLabel; @@ -200,7 +192,6 @@ TfrmPackageEditor = class(TfrmTikeEditor) // I4689 panFileActions: TPanel; lblFileActions: TLabel; editOutPath: TEdit; - cmdCompileInstaller: TButton; cmdAddToProject: TButton; cmdBuildPackage: TButton; Label5: TLabel; @@ -256,8 +247,6 @@ TfrmPackageEditor = class(TfrmTikeEditor) // I4689 procedure cmdUninstallClick(Sender: TObject); procedure cmdOpenContainingFolderClick(Sender: TObject); procedure cmdOpenFileClick(Sender: TObject); - procedure cmdCompileInstallerClick(Sender: TObject); - procedure cmdInstallWithClick(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure pagesChanging(Sender: TObject; var AllowChange: Boolean); @@ -395,7 +384,6 @@ implementation CharMapDropTool, CharMapInsertMode, - CompilePackageInstaller, Keyman.Developer.System.Project.kpsProjectFile, Keyman.Developer.System.Project.kpsProjectFileAction, Keyman.Developer.System.ServerAPI, @@ -492,17 +480,6 @@ procedure TfrmPackageEditor.SourceChanged(Sender: TObject); Modified := True; end; -procedure TfrmPackageEditor.cmdCompileInstallerClick(Sender: TObject); -begin - if Untitled or Modified then // I2178 - ShowMessage('You must save the package before you can build it.') - else - begin - frmMessages.Clear; - DoAction(pfaCompileInstaller); - end; -end; - procedure TfrmPackageEditor.cmdCopyDebuggerLinkClick(Sender: TObject); begin try @@ -1267,17 +1244,6 @@ procedure TfrmPackageEditor.cmdInstallClick(Sender: TObject); DoAction(pfaInstall); end; -procedure TfrmPackageEditor.cmdInstallWithClick(Sender: TObject); -begin - dlgOpenProductInstaller.FileName := pack.KPSOptions.MSIFileName; - if dlgOpenProductInstaller.Execute then - begin - pack.KPSOptions.MSIFileName := dlgOpenProductInstaller.FileName; - Modified := True; - UpdateData; - end; -end; - {------------------------------------------------------------------------------- - Display refresh routines - -------------------------------------------------------------------------------} @@ -1350,10 +1316,6 @@ procedure TfrmPackageEditor.UpdateData; editStartMenuPath.Text := pack.StartMenu.Path; editOutPath.Text := (ProjectFile as TkpsProjectFile).TargetFilename; // I4688 - editBootstrapMSI.Text := pack.KPSOptions.MSIFileName; - if pack.KPSOptions.MSIFileName = '' - then editInstallerOutputFilename.Text := '' - else editInstallerOutputFilename.Text := (ProjectFile as TkpsProjectFile).TargetInstallerFileName; // I4688 if lbFiles.Items.Count > 0 then lbFiles.ItemIndex := 0; lbFilesClick(lbFiles); @@ -1983,7 +1945,6 @@ procedure TfrmPackageEditor.RefreshTargetPanels; end; panBuildDesktop.Visible := FHasDesktopTarget; - panBuildWindowsInstaller.Visible := FHasDesktopTarget; panBuildMobile.Visible := FHasMobileTarget; end; diff --git a/developer/src/tike/project/Keyman.Developer.System.Project.kpsProjectFileAction.pas b/developer/src/tike/project/Keyman.Developer.System.Project.kpsProjectFileAction.pas index 1f681f28c07..c7a7cafcc5c 100644 --- a/developer/src/tike/project/Keyman.Developer.System.Project.kpsProjectFileAction.pas +++ b/developer/src/tike/project/Keyman.Developer.System.Project.kpsProjectFileAction.pas @@ -15,24 +15,13 @@ interface type TkpsProjectFileAction = class(TkpsProjectFile) - private - procedure SelfMessage(Sender: TObject; msg: string; State: TProjectLogState); // I4706 - public - function CompilePackageInstaller(APack: TKPSFile; FSilent: Boolean): Boolean; function CompilePackage: Boolean; function Clean: Boolean; end; implementation -uses - compile, - CompilePackageInstaller, - Keyman.Developer.System.ValidateKpsFile, - PackageInfo, - utilexecute; - function TkpsProjectFileAction.CompilePackage: Boolean; var w: TKmcWrapper; @@ -46,45 +35,6 @@ function TkpsProjectFileAction.CompilePackage: Boolean; end; end; -function TkpsProjectFileAction.CompilePackageInstaller(APack: TKPSFile; FSilent: Boolean): Boolean; -var - pack: TKPSFile; -begin - HasCompileWarning := False; // I4706 - - if APack = nil then - begin - pack := TKPSFile.Create; - pack.FileName := FileName; - pack.LoadXML; - end - else - pack := APack; - - try - try - Result := DoCompilePackageInstaller(pack, SelfMessage, FSilent, '', TargetInstallerFilename, '', False, True, '', '', '', False, False); - if HasCompileWarning and (WarnAsError or OwnerProject.Options.CompilerWarningsAsErrors) then // I4706 - Result := False; - - if Result - then Log(plsSuccess, '''' + FileName + ''' compiled successfully.', 0, 0) - else Log(plsFailure, '''' + FileName + ''' was not compiled successfully.', 0, 0); - except - on E:Exception do - begin - Log(plsError, E.Message, CERR_ERROR, 0); - Log(plsFailure, '''' + FileName + ''' was not compiled successfully.', 0, 0); - Result := False; - end; - end; - - finally - if APack = nil then - pack.Free; - end; -end; - function TkpsProjectFileAction.Clean: Boolean; begin CleanFile(OutputFileName); @@ -92,13 +42,6 @@ function TkpsProjectFileAction.Clean: Boolean; Result := True; end; -procedure TkpsProjectFileAction.SelfMessage(Sender: TObject; msg: string; State: TProjectLogState); // I4706 -begin - if State = plsWarning then - HasCompileWarning := True; - Log(State, msg, 0, 0); -end; - initialization RegisterProjectFileType('.kps', TkpsProjectFileAction); end. diff --git a/developer/src/tike/project/Keyman.Developer.UI.Project.ProjectFileUI.pas b/developer/src/tike/project/Keyman.Developer.UI.Project.ProjectFileUI.pas index 50321c6bf4c..6026fb2377e 100644 --- a/developer/src/tike/project/Keyman.Developer.UI.Project.ProjectFileUI.pas +++ b/developer/src/tike/project/Keyman.Developer.UI.Project.ProjectFileUI.pas @@ -34,7 +34,7 @@ interface type TProjectFileAction = (pfaCompile, pfaInstall, pfaUninstall, pfaDebug, - pfaTestKeymanWeb, pfaCompileInstaller, pfaFontHelper, pfaFontDialog, pfaClean); // I4057 + pfaTestKeymanWeb, pfaFontHelper, pfaFontDialog, pfaClean); // I4057 TProjectUI = class(TProject) private diff --git a/developer/src/tike/project/Keyman.Developer.UI.Project.UfrmProject.pas b/developer/src/tike/project/Keyman.Developer.UI.Project.UfrmProject.pas index ad0fc42ec32..992a4491c36 100644 --- a/developer/src/tike/project/Keyman.Developer.UI.Project.UfrmProject.pas +++ b/developer/src/tike/project/Keyman.Developer.UI.Project.UfrmProject.pas @@ -549,21 +549,6 @@ procedure TfrmProject.WebCommandProject(Command: WideString; Params: TStringList (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompile, False); end; end - else if Command = 'package_compileallinstallers' then // I4734 - begin - ClearMessages; - for i := 0 to FGlobalProject.Files.Count - 1 do - begin - if FGlobalProject.Files[i] is TkpsProjectFile then - (FGlobalProject.Files[i].UI as TProjectFileUI).DoAction(pfaCompileInstaller, False); - end; - end - else if Command = 'package_compileinstaller' then - begin - ClearMessages; - pf := SelectedProjectFile; - if Assigned(pf) then (pf.UI as TProjectFileUI).DoAction(pfaCompileInstaller, False); - end else if Command = 'package_cleanall' then // I4692 begin ClearMessages; diff --git a/developer/src/tike/project/Keyman.Developer.UI.Project.kpsProjectFileUI.pas b/developer/src/tike/project/Keyman.Developer.UI.Project.kpsProjectFileUI.pas index 672a8c92bfa..410a2727252 100644 --- a/developer/src/tike/project/Keyman.Developer.UI.Project.kpsProjectFileUI.pas +++ b/developer/src/tike/project/Keyman.Developer.UI.Project.kpsProjectFileUI.pas @@ -35,9 +35,7 @@ TkpsProjectFileUI = class(TOpenableProjectFileUI) function InstallPackage: Boolean; function UninstallPackage: Boolean; function CompilePackage: Boolean; - function CompilePackageInstaller(FSilent: Boolean): Boolean; - function GetPack: TKPSFile; function GetProjectFile: TkpsProjectFileAction; function TestPackageState(FCompiledName: string): Boolean; public @@ -83,22 +81,12 @@ function TkpsProjectFileUI.CompilePackage: Boolean; TestPackageOnline; end; -function TkpsProjectFileUI.CompilePackageInstaller(FSilent: Boolean): Boolean; -begin - Result := False; - if ProjectFile.Modified then - if not modActionsMain.actFileSave.Execute then Exit; - - Result := ProjectFile.CompilePackageInstaller(GetPack, FSilent); -end; - function TkpsProjectFileUI.DoAction(action: TProjectFileAction; FSilent: Boolean): Boolean; begin case action of pfaCompile: Result := CompilePackage; pfaInstall: Result := InstallPackage; pfaUninstall: Result := UninstallPackage; - pfaCompileInstaller: Result := CompilePackageInstaller(FSilent); pfaClean: Result := ProjectFile.Clean; pfaTestKeymanWeb: Result := TestPackageOnline; else @@ -106,13 +94,6 @@ function TkpsProjectFileUI.DoAction(action: TProjectFileAction; FSilent: Boolean end; end; -function TkpsProjectFileUI.GetPack: TKPSFile; -begin - if Assigned(MDIChild) - then with MDIChild as TfrmPackageEditor do Result := GetPack - else Result := nil; -end; - function TkpsProjectFileUI.GetProjectFile: TkpsProjectFileAction; begin Result := FOwner as TkpsProjectFileAction; diff --git a/developer/src/tike/tike.dpr b/developer/src/tike/tike.dpr index c3c417a8170..15993827af9 100644 --- a/developer/src/tike/tike.dpr +++ b/developer/src/tike/tike.dpr @@ -16,7 +16,6 @@ uses compile in '..\common\delphi\compiler\compile.pas', KeymanDeveloperOptions in 'main\KeymanDeveloperOptions.pas', UfrmKeyTest in 'debug\UfrmKeyTest.pas' {frmKeyTest}, - CompilePackage in '..\common\delphi\compiler\CompilePackage.pas', KeymanDeveloperUtils in 'main\KeymanDeveloperUtils.pas', UfrmEditor in 'child\UfrmEditor.pas' {frmEditor}, MenuImgList in '..\common\delphi\components\MenuImgList.pas', @@ -138,7 +137,6 @@ uses VisualKeyboardExportPNG in '..\..\..\common\windows\delphi\visualkeyboard\VisualKeyboardExportPNG.pas', MSXML2_TLB in '..\..\..\common\windows\delphi\tlb\MSXML2_TLB.pas', CharacterInfo in 'main\CharacterInfo.pas', - CompilePackageInstaller in '..\common\delphi\compiler\CompilePackageInstaller.pas', UTikeDebugMode in 'main\UTikeDebugMode.pas', kmxfileconsts in '..\..\..\common\windows\delphi\keyboards\kmxfileconsts.pas', kmxfileutils in '..\..\..\common\windows\delphi\keyboards\kmxfileutils.pas', diff --git a/developer/src/tike/tike.dproj b/developer/src/tike/tike.dproj index f1af6898566..1f5ff54b221 100644 --- a/developer/src/tike/tike.dproj +++ b/developer/src/tike/tike.dproj @@ -139,7 +139,6 @@
frmKeyTest
-
frmEditor
@@ -319,7 +318,6 @@ - diff --git a/developer/src/tike/xml/project/distribution.xsl b/developer/src/tike/xml/project/distribution.xsl index 6b78ee608f9..998065b8427 100644 --- a/developer/src/tike/xml/project/distribution.xsl +++ b/developer/src/tike/xml/project/distribution.xsl @@ -97,10 +97,6 @@ Build keyman:compilefile?id= - - Build installer - keyman:package_compileinstaller?id= - Clean keyman:cleanfile?id= diff --git a/developer/src/tike/xml/project/packages.xsl b/developer/src/tike/xml/project/packages.xsl index 94d45113ccf..ff5a8e520a6 100644 --- a/developer/src/tike/xml/project/packages.xsl +++ b/developer/src/tike/xml/project/packages.xsl @@ -9,7 +9,7 @@

- +
New package... @@ -90,7 +90,7 @@ auto - +

@@ -106,7 +106,7 @@
- + @@ -121,12 +121,6 @@ Build keyman:compilefile?id=
- - - Build installer - keyman:package_compileinstaller?id= - - Clean keyman:cleanfile?id= @@ -154,7 +148,7 @@ - + @@ -196,5 +190,5 @@
- + \ No newline at end of file diff --git a/docs/build/windows.md b/docs/build/windows.md index 9faebc3d632..81a96a4a209 100644 --- a/docs/build/windows.md +++ b/docs/build/windows.md @@ -101,7 +101,7 @@ Building: * Ant * Gradle * Maven -* OpenJDK 11 +* Optional: OpenJDK 11 (https://learn.microsoft.com/en-us/java/openjdk/download) ```ps1 # Elevated PowerShell @@ -254,8 +254,8 @@ choco install openjdk choco install visualstudio2019community visualstudio2019-workload-nativedesktop visualstudio2019buildtools ``` * Verify required build tools are installed - * Run `Visual Studio Installer` - * Check the `Individual components` tab + * Run `Visual Studio Installer` + * Check the `Individual components` tab * Verify `MSVC v142 - VS 2019 c++ x64/x86 build tools (Latest)` is installed. If not, install it. Recommended: configure Visual Studio to use two-space tab stops: diff --git a/oem/firstvoices/windows/src/inst/Makefile b/oem/firstvoices/windows/src/inst/Makefile index 2f3be6990b9..488b837d255 100644 --- a/oem/firstvoices/windows/src/inst/Makefile +++ b/oem/firstvoices/windows/src/inst/Makefile @@ -8,9 +8,9 @@ DESKTOP_FILES=firstvoices.wixobj desktopui.wixobj MSI=firstvoices.msi +EXE_ZIP=firstvoices.zip EXE=firstvoices.exe KMP=fv_all.kmp -INTEXE=firstvoices-fv_all.exe APPTITLE="Keyman for FirstVoices" TITLEIMAGE=setuptitle.png @@ -48,12 +48,19 @@ prereq: cd $(FVROOT)\src\inst desktop: prereq + rem compile .msi $(MAKE) -fdownload.mak candle-desktop $(WIXLIGHT) -dWixUILicenseRtf=License.rtf -out $(MSI) -ext WixUIExtension $(DESKTOP_FILES) $(SIGNCODE) /d $(APPTITLE) $(MSI) - $(ROOT)\bin\buildtools\buildpkg -m $(MSI) -s $(ROOT)\bin\desktop -l license.html -a $(APPTITLE) -i $(TITLEIMAGE) -n "FirstVoices Keyboards" -startDisabled -startWithConfiguration $(KMP) - if exist $(EXE) del $(EXE) - ren $(INTEXE) $(EXE) + + rem build self-extracting archive + $(MAKE) -fdownload.mak setup-inf + $(WZZIP) $(EXE_ZIP) $(MSI) license.html setup.inf $(TITLEIMAGE) $(KMP) + -del setup.inf + $(COPY) /b $(ROOT)\bin\desktop\setup-redist.exe + $(EXE_ZIP) $(EXE) + -del $(EXE_ZIP) + + rem sign and copy files $(SIGNCODE) /d $(APPTITLE) $(EXE) $(MAKE) -fdownload.mak copyredist-desktop diff --git a/oem/firstvoices/windows/src/inst/download.in b/oem/firstvoices/windows/src/inst/download.in index f31c2fe3c40..98d23e1e286 100644 --- a/oem/firstvoices/windows/src/inst/download.in +++ b/oem/firstvoices/windows/src/inst/download.in @@ -22,3 +22,15 @@ candle-desktop: $(WIXHEAT) dir ..\xml -o desktopui.wxs -ag -cg DesktopUI -dr INSTALLDIR -suid -var var.DESKTOPUISOURCE -wx -nologo $(WIXCANDLE) -dOEMNAME="$(OEMNAME)" -dPRODUCTNAME="$(PRODUCTNAME)" -dROOT="$(ROOT)" -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dPRODUCTID=$GUID1 -dDESKTOPUISOURCE=..\xml firstvoices.wxs desktopui.wxs +setup-inf: + echo [Setup] > setup.inf + echo Version=$VersionWin >> setup.inf + echo MSIFileName=firstvoices.msi >> setup.inf + echo MSIOptions= >> setup.inf + echo AppName=Keyman for FirstVoices >> setup.inf + echo License=license.html >> setup.inf + echo TitleImage=setuptitle.png >> setup.inf + echo StartDisabled=True >> setup.inf + echo StartWithConfiguration=True >> setup.inf + echo [Packages] >> setup.inf + echo fv_all.kmp=FirstVoices Keyboards >> setup.inf diff --git a/windows/src/buildtools/Makefile b/windows/src/buildtools/Makefile index d6621a889de..06053170500 100644 --- a/windows/src/buildtools/Makefile +++ b/windows/src/buildtools/Makefile @@ -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 diff --git a/windows/src/buildtools/buildpkg/Makefile b/windows/src/buildtools/buildpkg/Makefile deleted file mode 100644 index 056011b0bdd..00000000000 --- a/windows/src/buildtools/buildpkg/Makefile +++ /dev/null @@ -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 diff --git a/windows/src/buildtools/buildpkg/buildpkg.dpr b/windows/src/buildtools/buildpkg/buildpkg.dpr deleted file mode 100644 index d2c7d21cfa7..00000000000 --- a/windows/src/buildtools/buildpkg/buildpkg.dpr +++ /dev/null @@ -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. diff --git a/windows/src/buildtools/buildpkg/buildpkg.dproj b/windows/src/buildtools/buildpkg/buildpkg.dproj deleted file mode 100644 index 16dbddf62fb..00000000000 --- a/windows/src/buildtools/buildpkg/buildpkg.dproj +++ /dev/null @@ -1,1053 +0,0 @@ - - - {662A6FEA-4D2E-42E8-9292-1B3EE5A1E480} - buildpkg.dpr - True - Debug - 1 - Console - None - 18.8 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - buildpkg - $(BDS)\bin\delphi_PROJECTICON.ico - $(BDS)\bin\delphi_PROJECTICNS.icns - true - true - $(DELPHI)\lib;$(DCC_UnitSearchPath) - false - 28 - true - 5 - System;Xml;Data;Datasnap;Web;Soap;Winapi;Vcl;System.Win;Vcl.Imaging;$(DCC_Namespace) - true - VISUALKEYBOARD_NOCUSTOMBITMAP;VERSION_KEYMAN_REDIST;RELEASE_KEYMAN;EXCMAGIC_GUI;$(DCC_Define) - 1 - 3 - false - false - 3081 - false - true - false - CompanyName=;FileDescription=Tavultesoft Keyboard Manager;FileVersion=5.0.0.28;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - Vcl40;Vclx40;vcljpg40;comp51;VCLZipD4;dclkmn;Vcl50;Vclx50;vclie50;Inetdb50;Inet50;Vcldb50;$(DCC_UsePackage) - 2C400000 - false - true - None - true - .\obj\$(Platform)\$(Config) - .\bin\$(Platform)\$(Config) - - - Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) - 1033 - - - false - 0 - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - - - -m c:\temp\xx\keymandesktop90.msi -l c:\temp\xx\license.html -n "GFF Amharic" -s c:\temp\xx\ c:\temp\xx\gff-amh-powerpack-7.kmp - c:\temp\xx\ - CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName) - 1033 - - - - MainSource - - - - - - - - - - - - - - - - - - - - - - - - - -
TikeForm - TTntForm -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - -
- - Delphi.Personality.12 - - - - - buildpkg.dpr - - - $00000C09 - - - False - True - 5 - 0 - 0 - 32 - False - False - False - False - False - 3081 - 1252 - - - - Tavultesoft Keyboard Manager - 5.0.0.32 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - True - False - - - - - true - - - - - true - - - - - true - - - - - true - - - - - true - - - - - buildpkg.exe - true - - - - - 1 - - - 0 - - - - - classes - 1 - - - classes - 1 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - 1 - - - 0 - - - - - 1 - .framework - - - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - - - - 1 - - - 1 - - - 1 - - - - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - - - 12 - - - - -
diff --git a/windows/src/buildtools/buildpkg/buildpkg.res b/windows/src/buildtools/buildpkg/buildpkg.res deleted file mode 100644 index 6876088a664..00000000000 Binary files a/windows/src/buildtools/buildpkg/buildpkg.res and /dev/null differ diff --git a/windows/src/buildtools/buildpkg/buildpkgmain.pas b/windows/src/buildtools/buildpkg/buildpkgmain.pas deleted file mode 100644 index 29882895a62..00000000000 --- a/windows/src/buildtools/buildpkg/buildpkgmain.pas +++ /dev/null @@ -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 [-l ] [-i ] [-a ] (-s )|(-n )'); // 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. diff --git a/windows/src/buildtools/buildpkg/version.rc b/windows/src/buildtools/buildpkg/version.rc deleted file mode 100644 index 134c4bf8c3c..00000000000 --- a/windows/src/buildtools/buildpkg/version.rc +++ /dev/null @@ -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 diff --git a/windows/src/desktop/inst/Makefile b/windows/src/desktop/inst/Makefile index c247da987b6..68bb12a7352 100644 --- a/windows/src/desktop/inst/Makefile +++ b/windows/src/desktop/inst/Makefile @@ -28,11 +28,19 @@ prereq-resources: $(SIGNCODE) /d "Keyman Resources" desktop_resources.dll desktop: prereq + rem compile .msi $(MAKE) -fdownload.mak candle $(WIXLIGHT) -dWixUILicenseRtf=License.rtf -out keymandesktop.msi -ext WixUIExtension $(DESKTOP_FILES) $(SIGNCODE) /d "Keyman" keymandesktop.msi -# TODO: replace buildpkg with kmc? Or promote it to developer? - $(ROOT)\bin\buildtools\buildpkg -m keymandesktop.msi -s $(ROOT)\bin\desktop -l license.html + + rem build self-extracting archive + $(MAKE) -fdownload.mak setup-inf + $(WZZIP) keymandesktop.zip keymandesktop.msi license.html setup.inf + -del setup.inf + $(COPY) /b $(ROOT)\bin\desktop\setup-redist.exe + keymandesktop.zip keymandesktop.exe + -del keymandesktop.zip + + rem sign and copy files $(SIGNCODE) /d "Keyman" keymandesktop.exe $(MAKE) -fdownload.mak copyredist-desktop @@ -51,6 +59,8 @@ clean: -del /Q desktopui.wxs -del /Q cef.wxs -del /Q locale.wxs + -del keymandesktop.zip + -del setup.inf check: if not exist $(ROOT)\src\engine\inst\keymanengine.msm $(MAKE) check-engine diff --git a/windows/src/desktop/inst/download.in b/windows/src/desktop/inst/download.in index 0bf062eeba4..3fc996840d4 100644 --- a/windows/src/desktop/inst/download.in +++ b/windows/src/desktop/inst/download.in @@ -63,3 +63,15 @@ candle-locale: # locale files are in desktop/locale/* $(WIXHEAT) dir ..\kmshell\locale -o locale.wxs -ag -cg Locale -dr INSTALLDIR -var var.LOCALESOURCE -wx -nologo $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dPRODUCTID=$GUID1 -dLOCALESOURCE=..\kmshell\locale locale.wxs + +# +# Build setup.inf +# + +setup-inf: + echo [Setup] > setup.inf + echo Version=$VersionWin >> setup.inf + echo MSIFileName=keymandesktop.msi >> setup.inf + echo MSIOptions= >> setup.inf + echo License=license.html >> setup.inf + echo [Packages] >> setup.inf