Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-08

Problems creating Lazarus installer + readme/batch patch

14 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Hi list,

Trying to create a Lazarus installer on Windows:

1. gdb path problem
the readme says:

A.5 Lazarus binaries Some binaries from a lazarus/binaries svn tree. These binaries (like gdb and the qt interface dll) are distributed with Lazarus, but are not built from source.

I did
svn co http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/ c:\development\lazbinaries\
and passed that directory to create_intaller as the 3rd argument

create_installer.bat has
:: Path to the lazarus third party binaries checked out of subversion SET LAZSVNBINDIR=%3
...
SET FPCFULLTARGET=%FPCTARGETCPU%-%FPCTARGETOS%
...

my c:\development\lazbinaries shows this tree:
????gdb
? ????bin
????qt
but this:
:: Path to the directory containing the mingw gdb debugger installation :: it should have the debugger with the name gdb.exe in its bin subdirectory SET GDBDIR=%LAZSVNBINDIR%\%FPCFULLTARGET%\gdb

is looking for c:\development\lazbinaries\i386-win32\gdb

What repository should I use instead of the one I specified?

2. inno setup error
I get
C:\Development\lazarus\tools\install\win>"D:\Program Files (x86)\Inno Setup 5\ISCC.exe" lazarus.iss 1>>installer.log
Error on line 102 in
C:\Development\lazarus\tools\install\win\lazarus.iss: No files found matching "c:\development\lazbinaries\i386-win32\qt\*.dll" Compile aborted.

Same problem, really, I'd guess..

Any suggestions?

BTW, patch attached that:
- clarify/update readme (mentioned 2.2 fpc compiler instead of 2.6.0)
- lets you use environment variables for BUILDDIR

Also below are my complete notes on what I did FYI

Thanks,
Reinier

Followed lazarus\tools\install\win\readme.txt; notes below refer to this and add some details
rem A.1 Inno Setup
rem I used Inno Setup version 5.4.1 (unicode)... dating back to 2010. Newer versions will probably work, too :)

rem A.3 FPC build sources:
rem Using fixes 2.6 here (the fixes to the latest stable version at this time)
cd /d c:\development
mkdir c:\development\fpcbuild
svn checkout
http://svn.freepascal.org/svn/fpcbuild/branches/fixes_2_6_0/ c:\development\fpcbuild

rem A.4 Lazarus sources:
rem I've got my Lazarus sources in c:\development\lazarus (downloaded by fpcup)

rem A.5 Lazarus binaries
rem Hum, where is the svn for that? Let's guess
mkdir c:\development\lazbinaries
svn checkout http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/ c:\development\lazbinaries\

rem A.6 Latest release fpc compiler
rem Have a 2.6.0 i386 compiler in c:\development\fpcbootstrap\ppc386.exe (downloaded by fpcup)

rem B adjust C:\Development\lazarus\tools\install\win\create_installer.bat rem didn't do that, instead set environment variables to my situation mkdir c:\development\lazarusbuild
rem Set BUILDDIR to c:\development\lazarusbuild
SET BUILDDIR=c:\development\lazarusbuild
rem (though in current batch script this won't be picked up and output goes to c:\temp\lazarusbuild)
rem so edited the batch from:
rem SET BUILDDIR=c:\temp\lazbuild
rem to:
rem if [%BUILDDIR%]==[] SET BUILDDIR=c:\temp\lazbuild

rem set SVN to my situation:
SET SVN="D:\Program Files\SlikSvn\bin\svn.exe"

rem set ISCC to my situation:
SET ISCC="D:\Program Files (x86)\Inno Setup 5\ISCC.exe"

rem check:
SET

rem C run the script
cd /d C:\Development\lazarus\tools\install\win
create_installer.bat c:\development\fpcbuild c:\development\lazarus c:\development\lazbinaries c:\development\fpcbootstrap\ppc386.exe

It ran for about 8 minutes on my pc.

Log ends up in
C:\Development\lazarus\tools\install\win\installer.log -------------- next part --------------
Index: tools/install/win/create_installer.bat
=================================================================== --- tools/install/win/create_installer.bat (revision 38099) +++ tools/install/win/create_installer.bat (working copy) @@ -10,7 +10,7 @@

:: Path to build directory.
:: In this directory an image of the installation will be built. -SET BUILDDIR=c:\temp\lazbuild
+if [%BUILDDIR%]==[] SET BUILDDIR=c:\temp\lazbuild

:: Path to the svn executable
if [%SVN%]==[] SET SVN="c:\program files\subversion\bin\svn.exe" Index: tools/install/win/readme.txt
=================================================================== --- tools/install/win/readme.txt (revision 38099)
+++ tools/install/win/readme.txt (working copy)
@@ -10,7 +10,7 @@
I used Inno Setup, a free installer for Windows programs. You can download it from http://www.jrsoftware.org/, and you need the QuickStart Pack and during installation choose Inno Setup Preprocessor too.

A.2 Subversion
-The build script assumes you have the Subversion installed. You can download it from http://subversion.tigris.org/, you can use the package with setup in name. +The build script assumes you have the Subversion client installed. You can download it from http://subversion.tigris.org/, you can use the package with setup in name.

A.3 FPC sources
The build script assumes you have a svn version of the fpcbuild sources. For information about getting the fpc sources from svn see: http://www.freepascal.org/ @@ -22,7 +22,7 @@
Some binaries from a lazarus/binaries svn tree. These binaries (like gdb and the qt interface dll) are distributed with Lazarus, but are not built from source.

A.6. The latest release of the fpc compiler
-Currently the latest release is fpc 2.2.0. You need just the ppcXXX.exe (ppc386.exe for win32 and ppcx64.exe for win64) to bootstrap compilation of the current fpc version. +Currently the latest release is fpc 2.6.0. You need just the ppcXXX.exe (ppc386.exe for win32 and ppcx64.exe for win64) to bootstrap compilation of the current fpc version.

B Adjust create_installer.bat to your configuration

@@ -38,9 +38,9 @@
create_installer.bat FPCSVNDIR LAZSVNDIR LAZSVNBINDIR RELEASE_PPC

where:
-FPCSVNDIR: Path to the fpc sources checked out of svn -LAZSVNDIR: Path to the lazarus sources checked out of svn -LAZSVNBINDIR: Path to the svn lazarus binaries
-RELEASE_PPC: Path to fpc 2.0.2 compiler
+FPCSVNDIR: Path to the fpc sources checked out of svn (see A.3) +LAZSVNDIR: Path to the lazarus sources checked out of svn (see A.4) +LAZSVNBINDIR: Path to the svn lazarus binaries (see A.5) +RELEASE_PPC: Path to the latest FPC release compiler (see A.6)

Just do it. Wait about 40 minutes (on 2.6 GHz P-IV). A log file named installer.log will be written to the current directory and setup file will be in the Output subdirectory of the current directory.

Reply by email

Martin
to Reinier Olislagers
Reinier Olislagers wrote 12 lines
Hi list, Trying to create a Lazarus installer on Windows: 1. gdb path problem the readme says: > A.5 Lazarus binaries > Some binaries from a lazarus/binaries svn tree. These binaries (like gdb and the qt interface dll) are distributed with Lazarus, but are not built from source. I did svn co http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/ c:\development\lazbinaries\ and passed that directory to create_intaller as the 3rd argument

You need to check out svn co
http://svn.freepascal.org/svn/lazarus/binaries

You only got one folder in it. But thu installer can run for 64 bit too, so it chooses the path itself

Show quoted text 9 lines
2. inno setup error I get C:\Development\lazarus\tools\install\win>"D:\Program Files (x86)\Inno Setup 5\ISCC.exe" lazarus.iss 1>>installer.log Error on line 102 in C:\Development\lazarus\tools\install\win\lazarus.iss: No files found matching "c:\development\lazbinaries\i386-win32\qt\*.dll" Compile aborted.

Same issue. check out the full binaries for all platforms, and let the installer deal with it

Show quoted text 8 lines
Same problem, really, I'd guess.. Any suggestions? BTW, patch attached that: - clarify/update readme (mentioned 2.2 fpc compiler instead of 2.6.0) - lets you use environment variables for BUILDDIR

I will look at it.

Reply by email

Reinier Olislagers
to Martin
Martin wrote 21 lines
On 01/08/2012 07:20, Reinier Olislagers wrote: > Hi list, > > Trying to create a Lazarus installer on Windows: > > 1. gdb path problem > the readme says: >> A.5 Lazarus binaries >> Some binaries from a lazarus/binaries svn tree. These binaries (like >> gdb and the qt interface dll) are distributed with Lazarus, but are >> not built from source. > I did > svn co http://svn.freepascal.org/svn/lazarus/binaries/i386-win32/ > c:\development\lazbinaries\ > and passed that directory to create_intaller as the 3rd argument You need to check out svn co http://svn.freepascal.org/svn/lazarus/binaries You only got one folder in it. But thu installer can run for 64 bit too, so it chooses the path itself

Oh Martin, I can't believe I overlooked that ;)
Thanks a lot ;)

> BTW, patch attached that: > - clarify/update readme (mentioned 2.2 fpc compiler instead of 2.6.0) > - lets you use environment variables for BUILDDIR I will ,

Reinier

Reply by email

Martin
to Reinier Olislagers: Trying to create a Lazarus installer on Windows: 1. gdb path problem the readme says: I…
Reinier Olislagers wrote 5 lines
BTW, patch attached that: - clarify/update readme (mentioned 2.2 fpc compiler instead of 2.6.0) - lets you use environment variables for BUILDDIR

I skipped the build dir part.

BUILDDIR is too generic as a name, and may be set by something else. If so, the script would delete whatever directory that points too.

Feel free to introduce

LAZTEMPBUILDDIR

But do not replace it everywere. Initialize BUILDDIR from the former. And maybe add a check, for empty, or none existent.

The hardcoded BUILDDIR points to a temp dir (and contains laz in the name), so it can always be deleted with little risk.

for a directory from the environment, this is not known. It could point to important data. So it should be required to bo empty already.

yes that prevents auto clean up, if a previous build fails (since on failure the content is left in place, so it can be inspected)

Reply by email

Reinier Olislagers
to Martin
Martin wrote
On 01/08/2012 07:20, Reinier Olislagers wrote: > BTW, patch attached that: > - clarify/update readme (mentioned 2.2 fpc compiler instead of 2.6.0) > - lets you use environment variables for BUILDDIR

Thanks!

Show quoted text 11 lines
I skipped the build dir part. BUILDDIR is too generic as a name, and may be set by something else. If so, the script would delete whatever directory that points too. Feel free to introduce LAZTEMPBUILDDIR But do not replace it everywere. Initialize BUILDDIR from the former. And maybe add a check, for empty, or none existent.

Thanks, make sense.
Done; check included, see patch.
Tested by setting LAZTEMPBUILDDIR and it does put the output there.

The patch also contains a fix for the iss file (a Pascal begin..end block without colon after the end ;) - otherwise I get this error:

Error on line 383 in
C:\Development\lazarus\tools\install\win\lazarus.iss: Column 2: Semicolon (';') expected.
Compile aborted.

If you want me to open mantis issues instead, I'd be happy to...

However, I now get this:
Error on line 417 in
C:\Development\lazarus\tools\install\win\lazarus.iss: Column 40: Type mismatch.

The lines in question:
var
  FileName: string;
  Content: string;
begin
  FileName := ExpandConstant(CurrentFileName);
  LoadStringFromFile(FileName, Content); //<-- line 417; col 40 is the ;

Those lines appear to have been there since r6092 (svn blame)... perhaps it's the fact I'm using Unicode Inno Setup or something I'm not seeing? (No experience with PascalScript or those functions, nor do I know what CurrentFileName is, so more or less blindly guessing)

I upgraded my Inno Setup to the latest, 5.5.1 unicode, no change.

Thanks,
Reinier

-------------- next part --------------
Index: tools/install/win/lazarus.iss
=================================================================== --- tools/install/win/lazarus.iss (revision 38105) +++ tools/install/win/lazarus.iss (working copy)
@@ -378,7 +378,7 @@

       MsgBox(s, mbInformation, MB_OK );
       Result := false;
       exit;

- end
+ end;

UpdateUninstallInfo;

     UnInstaller := RemoveQuotes(GetUninstallData('UninstallString'));

Index: tools/install/win/create_installer.bat
=================================================================== --- tools/install/win/create_installer.bat (revision 38105) +++ tools/install/win/create_installer.bat (working copy) @@ -10,7 +10,9 @@

:: Path to build directory.
:: In this directory an image of the installation will be built. +:: If the user specified a LAZTEMPBUILDDIR environment variable, use that instead. SET BUILDDIR=c:\temp\lazbuild
+if NOT [%LAZTEMPBUILDDIR%]==[] SET BUILDDIR=%LAZTEMPBUILDDIR%

:: Path to the svn executable
if [%SVN%]==[] SET SVN="c:\program files\subversion\bin\svn.exe"

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 15 lines
However, I now get this: Error on line 417 in C:\Development\lazarus\tools\install\win\lazarus.iss: Column 40: Type mismatch. The lines in question: var FileName: string; Content: string; begin FileName := ExpandConstant(CurrentFileName); LoadStringFromFile(FileName, Content); //<-- line 417; col 40 is the ; Those lines appear to have been there since r6092 (svn blame)... perhaps it's the fact I'm using Unicode Inno Setup or something I'm not seeing?

I think it's using Inno Setup Unicode.
from
http://www.jrsoftware.org/ishelp/
Other Information
Unicode Inno Setup
Unicode Pascal Scripting notes:
...LoadStringFromfile, SaveStringToFile,... are of type AnsiString now instead of String.
It seems that replacing the relevant String variables with explicit AnsiStrings might be a good idea which should work with ANSI Inno Setup.

And this "The Unicode compiler is more strict about correct ';' usage"... explains the earlier error I got.

I'll try to fix the script, then run the installer, then install ANSI InnoSetup, do the same, and if it works, submit a patch.

Reply by email

Martin
to Reinier Olislagers
Reinier Olislagers wrote 19 lines
On 1-8-2012 15:42, Reinier Olislagers wrote: > However, I now get this: > Error on line 417 in > C:\Development\lazarus\tools\install\win\lazarus.iss: Column 40: > Type mismatch. > > The lines in question: > var > FileName: string; > Content: string; > begin > FileName := ExpandConstant(CurrentFileName); > LoadStringFromFile(FileName, Content); //<-- line 417; col 40 is the ; > > Those lines appear to have been there since r6092 (svn blame)... perhaps > it's the fact I'm using Unicode Inno Setup or something I'm not seeing? I think it's using Inno Setup Unicode. from http://www.jrsoftware.org/ishelp/

Possible. So far the installer are build with the ansi setup.

Migrating to the unicode is on the list.

I'll try to fix the script, then run the installer, then install ANSI InnoSetup, do the same, and if it works, submit a patch.

Big step is to look at includes such as the Russian translation. If they can move into the [language] section, then inno should deal with it....

Reply by email

Reinier Olislagers
to Martin
Martin wrote 8 lines
On 01/08/2012 17:41, Reinier Olislagers wrote: > On 1-8-2012 15:42, Reinier Olislagers wrote: >> Those lines appear to have been there since r6092 (svn blame)... perhaps >> it's the fact I'm using Unicode Inno Setup or something I'm not seeing? > I think it's using Inno Setup Unicode. > from > http://www.jrsoftware.org/ishelp/ Possible. So far the installer are build with the ansi setup.

Certain ;)
Got the installer to run with unicode setup after some changes.

Migrating to the unicode is on the list. > I'll try to fix the script, then run the installer, then install ANSI > InnoSetup, do the same, and if it works, submit a patch.

Unfortunately I don't think we can have 1 script for both ansi and unicode inno setup.... unless PascalScript supports ifdefs and there's a compiler define for the unicode and one for the ansi version.

Assuming nobody is building on win9x, requiring unicode Inno (instead of ANSI Inno) shouldn't be a problem, I think.

Big step is to look at includes such as the Russian translation. If they can move into the [language] section, then inno should deal with it....

Will have to have a look at what you mean... been a while since I used Inno. AFAIU from the docs, Inno Unicode can read UTF8 files without BOM (and more); currently the Russian translation seems to be encoded using some ANSI codepage (1251 by heart?).

Meanwhile I have a working setup.exe but it seems to mix 2.6.0 and 2.6.1 directories below Lazarus (I'm using a 2.6.0 bootstrap and a 2.6.1 svn dir... don't know if that influences things).

Going to stop now... back tomorrow to have another go.

Regards,
Reinier

Reply by email

Martin
to Reinier Olislagers
Reinier Olislagers wrote 9 lines
On 1-8-2012 19:18, Martin wrote: > Migrating to the unicode is on the list. > >> I'll try to fix the script, then run the installer, then install ANSI >> InnoSetup, do the same, and if it works, submit a patch. Unfortunately I don't think we can have 1 script for both ansi and unicode inno setup.... unless PascalScript supports ifdefs and there's a compiler define for the unicode and one for the ansi version.

the inno preprocessor has...

Assuming nobody is building on win9x, requiring unicode Inno (instead of ANSI Inno) shouldn't be a problem, I think.

building, I guess not. Installing afaik yes

Show quoted text 6 lines
> Big step is to look at includes such as the Russian translation. If they > can move into the [language] section, then inno should deal with it.... Will have to have a look at what you mean... been a while since I used Inno. AFAIU from the docs, Inno Unicode can read UTF8 files without BOM (and more); currently the Russian translation seems to be encoded using some ANSI codepage (1251 by heart?).

according to inno docs, the unicode version can use some of the ansi files, and will convert them to utf8 itself (applies to language section)

Meanwhile I have a working setup.exe but it seems to mix 2.6.0 and 2.6.1 directories below Lazarus (I'm using a 2.6.0 bootstrap and a 2.6.1 svn dir... don't know if that influences things).

No idea.

Reply by email

Martin
to Martin
Martin wrote 9 lines
On 01/08/2012 20:51, Reinier Olislagers wrote: > On 1-8-2012 19:18, Martin wrote: >> Possible. So far the installer are build with the ansi setup. > Certain ;) > Got the installer to run with unicode setup after some changes. > Well. I threw out some unused code. And it comes down to 1 change in the pal script. (ignoring the fix of a missing semicolon)

And I believe I solved the translations too.

But I will only commit, once I have feedback on the Russian text

Reply by email

Reinier Olislagers
to Martin
Martin wrote 14 lines
On 01/08/2012 22:03, Martin wrote: > On 01/08/2012 20:51, Reinier Olislagers wrote: >> On 1-8-2012 19:18, Martin wrote: >>> Possible. So far the installer are build with the ansi setup. >> Certain ;) >> Got the installer to run with unicode setup after some changes. >> > > Well. I threw out some unused code. And it comes down to 1 change in > the pal script. (ignoring the fix of a missing semicolon) And I believe I solved the translations too. But I will only commit, once I have feedback on the Russian text

Thanks for your work, Martin.

After your commits, creating and running the setup using Unicode Inno Setup works well for me on Windows Vista x64 (English setup language). It did pick up my previous config (fpc compiler location etc) but that was expected and I could switch easily using the setup dialog that appeared.

I could select the Russian translation as well, and indeed, Cyrillic text appeared, but I can't speak Russian, so can't tell if it's all correct.

Thanks a lot!

Reinier

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 24 lines
On 1-8-2012 23:21, Martin wrote: > On 01/08/2012 22:03, Martin wrote: >> On 01/08/2012 20:51, Reinier Olislagers wrote: >>> On 1-8-2012 19:18, Martin wrote: >>>> Possible. So far the installer are build with the ansi setup. >>> Certain ;) >>> Got the installer to run with unicode setup after some changes. >>> >> >> Well. I threw out some unused code. And it comes down to 1 change in >> the pal script. (ignoring the fix of a missing semicolon) > > And I believe I solved the translations too. > > But I will only commit, once I have feedback on the Russian text Thanks for your work, Martin. After your commits, creating and running the setup using Unicode Inno Setup works well for me on Windows Vista x64 (English setup language). It did pick up my previous config (fpc compiler location etc) but that was expected and I could switch easily using the setup dialog that appeared. I could select the Russian translation as well, and indeed, Cyrillic text appeared, but I can't speak Russian, so can't tell if it's all correct.

Ran the Unicode Inno Setup... setup on Win98 (OSR2, IIRC), with KernelEx installed, and expected results:
- initial language choice: (presumably) Russian appears as a series of ??? instead of Cyrrilic text
- continuing install with English or Dutch gives error messages like "The program does not support the version of Windows your computer is running"
So, it appears no support for Win95/98, probably Me using the unicode version.

Thanks,
Reinier

Reply by email

Reinier Olislagers
to Reinier Olislagers: Trying to create a Lazarus installer on Windows: 1. gdb path problem the readme says: I…
Reinier Olislagers wrote
Hi list, Trying to create a Lazarus installer on Windows:

Thanks to Martin's help, I ended up with an installer.

Although the readme for the installer is quite good, I've documented the wiki with my notes describing my specific situation/paths, hope it can help somebody else:
http://wiki.lazarus.freepascal.org/Lazarus_Installer

Thanks,
Reinier

Reply by email