1. reiniero
  2. fpcup

Commits

reiniero  committed 1ac2d91

Wininstaller: use fpc build repository instead of fpc repo; force supplying needed info

  • Participants
  • Parent commits 7336ed3
  • Branches default

Comments (0)

Files changed (4)

File fpcup.ini

View file
 Name=installerlazwin
 ; For the installer, we place some SVN directories below the installdir;
 ; the user need not worry about these.
+; Note: the output setup executable will not be put there.
 Installdir=$(fpcdir)/../$(name)
 Enabled=0
 CreateInstaller1=Windows

File fpcup.res

Binary file modified.

File installeruniversal.pas

View file
     end;
 
     if FVerbose then WritelnLog('TUniversalInstaller: running CreateInstallers for '+exec,true);
-    Installer:=TWinInstaller.Create(FCompiler);
+    // Convert any relative path to absolute path:
+    InstallDir:=IncludeTrailingPathDelimiter(ExpandFileName(GetValue('InstallDir',sl)));
+    if InstallDir<>'' then
+      ForceDirectoriesUTF8(InstallDir);
+    Installer:=TWinInstaller.Create(InstallDir,FCompiler,FVerbose);
     try
       //todo: make installer module-level; split out config from build part; would also require fixed svn dirs etc
-      // Convert any relative path to absolute path:
-      InstallDir:=IncludeTrailingPathDelimiter(ExpandFileName(GetValue('InstallDir',sl)));
-      if InstallDir<>'' then
-        ForceDirectoriesUTF8(InstallDir);
       Installer.FPCDir:=FPCDir;
-      Installer.FPCBuildDir:=InstallDir+'fpcbuild';
-      Installer.LazarusBinaryDir:=InstallDir+'lazbin';
       Installer.LazarusDir:=FLazarusDir;
+      // todo: following not strictly needed:?!?
       Installer.LazarusPrimaryConfigPath:=FLazarusPrimaryConfigPath;
-      Installer.Verbose:=FVerbose;
-
       result:=Installer.BuildModuleCustom(ModuleName);
     finally
       Installer.Free;

File wininstaller.pas

View file
     property LazarusDir:string read FLazarusDir write FLazarusDir;
     // Lazarus primary config path
     property LazarusPrimaryConfigPath:string read FLazarusPrimaryConfigPath write FLazarusPrimaryConfigPath;
-    constructor Create(FPCCompiler: string);
+    constructor Create(InstallDirectory, FPCCompiler: string; Verbosity: boolean);
     destructor Destroy; override;
   end;
 
   FSVNClient.Verbose:=FVerbose;
   infoln('TWinInstaller: creating Lazarus installer. This may take a while...',etInfo);
 
+  // Basedirectory = install directory from fpcup.ini/universal module.
+  // We use it to put SVN repos needed for building.
+  if FFPCBuildDir='' then
+    FFPCBuildDir:=IncludeTrailingPathDelimiter(FBaseDirectory)+'fpcbuild';
+  if FLazarusBinaryDir='' then
+    FLazarusBinaryDir:=IncludeTrailingPathDelimiter(FBaseDirectory)+'lazbin';
+
   InstallerBatchDir:=IncludeTrailingPathDelimiter(FLazarusDir)+'tools\install\win';
 
   //checkout fpc build sources svn checkout
   or
   create_installer.bat FPCSVNDIR LAZSVNDIR LAZSVNBINDIR RELEASE_PPC IDE_WIDGETSET PATCHFILE CHMHELPFILES
   where:
-  FPCSVNDIR: Path to the fpc sources checked out of svn (see A.3)
+  FPCSVNDIR: Path to the fpc sources checked out of svn (see A.3) => i.e. the BUILD sources, not regular FPC source
   LAZSVNDIR: Path to the lazarus sources checked out of svn => FLazarusDir
   LAZSVNBINDIR: Path to the svn lazarus binaries (see A.5)
   RELEASE_PPC: Path to the FPC compiler required to start the build of fpc it FPCSVNDIR (see A.6)
   // MUST be set to create_installer.bat otherwise it can't find the fpcbuild/lazbuild scripts
   ProcessEx.CurrentDirectory:=IncludeTrailingPathDelimiter(InstallerBatchDir);
   ProcessEx.Parameters.Clear;
-  ProcessEx.Parameters.Add(ExcludeTrailingPathDelimiter(FFPCDir)); //FPCSVNDIR
+  ProcessEx.Parameters.Add(ExcludeTrailingPathDelimiter(FFPCBuildDir)); //FPCSVNDIR
   ProcessEx.Parameters.Add(ExcludeTrailingPathDelimiter(FLazarusDir)); //LAZSVNDIR
   ProcessEx.Parameters.Add(ExcludeTrailingPathDelimiter(FLazarusBinaryDir)); //LAZSVNBINDIR
   // Should officially be a bootstrap compiler but should work with current compiler:
   end;
 end;
 
-constructor TWinInstaller.Create(FPCCompiler: string);
+constructor TWinInstaller.Create(InstallDirectory, FPCCompiler: string; Verbosity: boolean);
 begin
   inherited Create;
+  FBaseDirectory:=InstallDirectory;
+  FVerbose:=Verbosity;
   FCompiler:=FPCCompiler;
   // Sensible default for an x64 Windows:
   FindInno;