reiniero avatar reiniero committed ddeadc3

wininstaller: properties for fpbuild and lazbin svn directories; use installdir in universal module

Comments (0)

Files changed (4)

 [FPCUPModule24]
 ; Create Windows installer
 Name=installer
-Installdir=$(fpcdir)/$(name)
+; For the installer, we place some SVN directories below the installdir;
+; the user need not worry about these.
+Installdir=$(fpcdir)/../$(name)
 Enabled=0
-CreateInstaller1=Windows
+CreateInstaller1=Windows
+Uninstall=rm -Rf $(Installdir)

Binary file modified.

installeruniversal.pas

 function TUniversalInstaller.CreateInstallers(Directive: string; sl: TStringList;ModuleName:string): boolean;
 var
   i:integer;
-  exec,output:string;
+  InstallDir,exec,output:string;
   Installer: TWinInstaller;
   Workingdir:string;
 begin
     Installer:=TWinInstaller.Create;
     try
       //todo: make installer module-level; split out config from build part; would also require fixed svn dirs etc
+      InstallDir:=IncludeTrailingPathDelimiter(GetValue('InstallDir',sl));
+      if InstallDir<>'' then
+        ForceDirectoriesUTF8(InstallDir);
       Installer.FPCDir:=FPCDir;
-      Installer.Verbose:=FVerbose;
+      Installer.FPCBuildDir:=InstallDir+'fpcbuild';
+      Installer.LazarusBinaryDir:=InstallDir+'lazbin';
       Installer.LazarusDir:=FLazarusDir;
       Installer.LazarusPrimaryConfigPath:=FLazarusPrimaryConfigPath;
+      Installer.Verbose:=FVerbose;
+
       Installer.BuildModuleCustom(ModuleName);
     finally
       Installer.Free;
     // Build module descendant customisation
     function BuildModuleCustom(ModuleName:string): boolean; virtual;
     property InnoSetupCompiler: string write FInnoSetupCompiler; //Path to the command line Inno Ssetup compiler (required)
+    // Directory with FPC build files repository
+    property FPCBuildDir:string write FFPCBuildDir;
     // FPC base directory
     property FPCDir:string read FFPCDir write FFPCDir;
+    // Directory with Lazarus binaries repository
+    property LazarusBinaryDir:string write FLazarusBinaryDir;
+    // Lazarus base directory
+    property LazarusDir:string read FLazarusDir write FLazarusDir;
     // Lazarus primary config path
     property LazarusPrimaryConfigPath:string read FLazarusPrimaryConfigPath write FLazarusPrimaryConfigPath;
-    // Lazarus base directory
-    property LazarusDir:string read FLazarusDir write FLazarusDir;
     constructor Create;
     destructor Destroy; override;
   end;
 
   //checkout fpc build sources svn checkout
   if FVerbose then WritelnLog(ClassName+': Getting FPC build repository',true);
-  FFPCBuildDir:=GetTempDir(false)+'fpcbuild';
   ForceDirectory(FFPCBuildDir);
   FSVNClient.LocalRepository:=FFPCBuildDir;
   FSVNClient.Repository:='http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_6_0';
 
   //checkout laz binaries
   if FVerbose then WritelnLog(ClassName+': Getting Lazarus binaries repository',true);
-  FLazarusBinaryDir:=GetTempDir(false)+'lazbin';
   ForceDirectory(FLazarusBinaryDir);
   FSVNClient.LocalRepository:=FLazarusBinaryDir;
   //todo: adapt for win64 (x86_64-win64/)
   if FVerbose then WritelnLog(ClassName+': Running '+ProcessEx.Executable,true);
   ProcessEx.Execute;
 
-  //change directory to build dir
-  //run script, installer will be in output subdir
+  //todo: Copy over installer from output subdir
 
   {check installer.log}
 end;
   FindInno;
   if FInnoSetupCompiler='' then
     FInnoSetupCompiler:='C:\Program Files (x86)\Inno Setup 5\Compil32.exe';
+  // Some defaults:
+  FFPCBuildDir:=GetTempDir(false)+'fpcbuild';
+  FLazarusBinaryDir:=GetTempDir(false)+'lazbin';
 end;
 
 destructor TWinInstaller.Destroy;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.