Compiling opsi-winst

realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Compiling opsi-winst

Beitragvon realflash » 23 Jan 2015, 15:34

I am trying to compile opsi-winst (with the goal of adding more logging so that I can find out why it's not installing anything as per my other thread).

I have Borland Delphi 7 Enterprise installed and the project opened, but I am having difficulty compiling. The compiling instructions just say:

Code: Alles auswählen

compile with delphi 7
required compiler option that values can be assigned to constants


I think this is probably a reference to Assignable typed constants being checked under Project > Options > Compiler. Is this right?

I'm trying to compile 4.11.4.12. When I open it, Delphi complains that wimain.pas is missing. Indeed, that file doesn't appear under the 4.11.4.12 tag, or any subsequent tags. It's only under trunk. Is this right?

I copied the missing file from trunk into the tag folder. When I compile, I get:

Code: Alles auswählen

[Error] packdefs.pas(3): Invalid compiler directive: 'MODE'

Is this right?

If I comment that directive out and compile, I get:

Code: Alles auswählen

[Error] zipinter.pas(95): Undeclared identifier: 'hwnd'


Are there more things I need to set up to get it to compile? Am I using the right product?

Thanks for your help.

realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Re: Compiling opsi-winst

Beitragvon realflash » 23 Jan 2015, 16:58

I've been able to get past the hwnd problem by setting Project > Options > Directories/Conditionals > Conditional defines and adding WINDOWS.

There were other files missing from 4.11.4.12 so I've given up trying to compile that and am now trying to compile trunk. I'm now stuck on

Code: Alles auswählen

[Fatal Error] wibtch.pas(28): File not found: 'LCLIntf.dcu'


This isn't in trunk, so I'm guessing I'm missing some undocumented external dependency. Can anyone tell me what it is?

realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Re: Compiling opsi-winst

Beitragvon realflash » 23 Jan 2015, 17:08

It's looking like Lazarus is the right thing to compile this with, rather than Delphi 7. Is the build process and its dependencies documented somewhere, please?

realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Re: Compiling opsi-winst

Beitragvon realflash » 26 Jan 2015, 15:50

I've now got this project to open in Lazarus after adding a number of missing dependencies. However, it does not compile. There are multiple errors when compiling, similar to this:

Code: Alles auswählen

DSiWin32.pas(2639,45) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
.

Please can someone help me. I'm going to have to give up with opsi soon if I can't get some more logging into to it to find out what is happening.

Full compilation log:

Code: Alles auswählen

wibtch.pas(192,19) Warning: An inherited method is hidden by "TFBatchOberflaeche.setVisible(Boolean);"
DSiWin32.pas(1790,17) Warning: Symbol "VARTYPE" is deprecated
DSiWin32.pas(1848,17) Warning: Symbol "VARTYPE" is deprecated
DSiWin32.pas(2136,72) Hint: Local variable "isAvailable" does not seem to be initialized
DSiWin32.pas(2136,59) Hint: Local variable "remoteName" does not seem to be initialized
DSiWin32.pas(2143,27) Hint: Local variable "netResource" does not seem to be initialized
DSiWin32.pas(2167,20) Hint: Local variable "fileOp" does not seem to be initialized
DSiWin32.pas(2276,20) Hint: Local variable "si" does not seem to be initialized
DSiWin32.pas(2282,50) Hint: Local variable "pi" does not seem to be initialized
DSiWin32.pas(2284,61) Warning: range check error while evaluating constants
DSiWin32.pas(2492,72) Hint: Local variable "totalFiles" does not seem to be initialized
DSiWin32.pas(2610,88) Hint: Local variable "lastModificationTime" does not seem to be initialized
DSiWin32.pas(2610,66) Hint: Local variable "lastAccessTime" does not seem to be initialized
DSiWin32.pas(2610,50) Hint: Local variable "creationTime" does not seem to be initialized
DSiWin32.pas(2639,45) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(2640,47) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(2641,53) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(2929,34) Hint: Local variable "winit" does not seem to be initialized
DSiWin32.pas(3022,12) Hint: Local variable "shareInfo9x" does not seem to be initialized
DSiWin32.pas(3113,98) Hint: Local variable "hToken" does not seem to be initialized
DSiWin32.pas(3150,27) Hint: Local variable "useWorkDir" does not seem to be initialized
DSiWin32.pas(3153,25) Hint: Local variable "startupInfo" does not seem to be initialized
DSiWin32.pas(3159,57) Hint: Local variable "processInfo" does not seem to be initialized
DSiWin32.pas(3194,76) Hint: Local variable "logonHandle" does not seem to be initialized
DSiWin32.pas(3197,31) Hint: Local variable "useWorkDir" does not seem to be initialized
DSiWin32.pas(3200,29) Hint: Local variable "startupInfo" does not seem to be initialized
DSiWin32.pas(3206,57) Hint: Local variable "processInfo" does not seem to be initialized
DSiWin32.pas(3266,30) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
DSiWin32.pas(3296,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
DSiWin32.pas(3300,39) Hint: Local variable "writePipe" does not seem to be initialized
DSiWin32.pas(3300,28) Hint: Local variable "readPipe" does not seem to be initialized
DSiWin32.pas(3302,21) Hint: Local variable "start" does not seem to be initialized
DSiWin32.pas(3310,29) Hint: Local variable "useWorkDir" does not seem to be initialized
DSiWin32.pas(3317,23) Hint: Local variable "processInfo" does not seem to be initialized
DSiWin32.pas(3386,75) Hint: Local variable "systemAffinityMask" does not seem to be initialized
DSiWin32.pas(3424,60) Hint: Local variable "count" does not seem to be initialized
DSiWin32.pas(3443,50) Hint: Local variable "processID" does not seem to be initialized
DSiWin32.pas(3459,95) Hint: Local variable "sidUse" does not seem to be initialized
DSiWin32.pas(3478,65) Warning: Local variable "defaulted" does not seem to be initialized
DSiWin32.pas(3478,54) Hint: Local variable "sid" does not seem to be initialized
DSiWin32.pas(3534,75) Hint: Local variable "exitTime" does not seem to be initialized
DSiWin32.pas(3551,84) Error: Call by var for arg no. 5 has to match exactly: Got "FILETIME" expected "_FILETIME"
DSiWin32.pas(3552,43) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(3553,39) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(3555,59) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1102,13) Hint: Found declaration: DSiFileTimeToMicroSeconds(_FILETIME):Int64;
DSiWin32.pas(3556,55) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1102,13) Hint: Found declaration: DSiFileTimeToMicroSeconds(_FILETIME):Int64;
DSiWin32.pas(3609,68) Hint: Local variable "processAffinityMask" does not seem to be initialized
DSiWin32.pas(3637,88) Hint: Local variable "systemAffinityMask" does not seem to be initialized
DSiWin32.pas(3637,68) Hint: Local variable "processAffinityMask" does not seem to be initialized
DSiWin32.pas(3652,73) Hint: Local variable "exitTime" does not seem to be initialized
DSiWin32.pas(3669,82) Error: Call by var for arg no. 5 has to match exactly: Got "FILETIME" expected "_FILETIME"
DSiWin32.pas(3670,43) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(3671,39) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(3673,59) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1102,13) Hint: Found declaration: DSiFileTimeToMicroSeconds(_FILETIME):Int64;
DSiWin32.pas(3674,55) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1102,13) Hint: Found declaration: DSiFileTimeToMicroSeconds(_FILETIME):Int64;
DSiWin32.pas(3702,76) Hint: Local variable "logonHandle" does not seem to be initialized
DSiWin32.pas(3728,85) Hint: Local variable "maxWorkingSetSize" does not seem to be initialized
DSiWin32.pas(3728,66) Hint: Local variable "minWorkingSetSize" does not seem to be initialized
DSiWin32.pas(3752,18) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(3774,26) Hint: Local variable "msg" does not seem to be initialized
DSiWin32.pas(4035,29) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4036,29) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4061,29) Hint: Local variable "utilWindowClass" does not seem to be initialized
DSiWin32.pas(4064,83) Hint: Local variable "tempClass" does not seem to be initialized
DSiWin32.pas(4086,45) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4087,45) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4226,24) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4229,7) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4243,40) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(4271,31) Hint: Local variable "msg" does not seem to be initialized
DSiWin32.pas(4304,73) Hint: Local variable "dwResult" does not seem to be initialized
DSiWin32.pas(4323,60) Warning: range check error while evaluating constants
DSiWin32.pas(4370,52) Hint: Local variable "isEnabled" does not seem to be initialized
DSiWin32.pas(4478,56) Hint: Local variable "foregroundRect" does not seem to be initialized
DSiWin32.pas(4479,50) Hint: Local variable "desktopRect" does not seem to be initialized
DSiWin32.pas(4790,39) Hint: Local variable "fileSysFlags" does not seem to be initialized
DSiWin32.pas(4790,25) Hint: Local variable "maxCompLen" does not seem to be initialized
DSiWin32.pas(4816,28) Hint: Local variable "fileSysFlags" does not seem to be initialized
DSiWin32.pas(4816,14) Hint: Local variable "maxCompLen" does not seem to be initialized
DSiWin32.pas(4906,77) Hint: Local variable "keyLayList" does not seem to be initialized
DSiWin32.pas(4909,37) Hint: Conversion between ordinals and pointers is not portable
DSiWin32.pas(5067,61) Hint: Local variable "hToken" does not seem to be initialized
DSiWin32.pas(5189,13) Warning: Symbol "Handle" is deprecated
DSiWin32.pas(5213,82) Hint: Local variable "accessToken" does not seem to be initialized
DSiWin32.pas(5218,80) Hint: Local variable "infoBufferSize" does not seem to be initialized
DSiWin32.pas(5227,149) Hint: Local variable "administrators" does not seem to be initialized
DSiWin32.pas(5300,59) Hint: Local variable "isWow64" does not seem to be initialized
DSiWin32.pas(5635,50) Hint: Local variable "findData" does not seem to be initialized
DSiWin32.pas(5893,42) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(1101,13) Hint: Found declaration: DSiFileTimeToDateTime(_FILETIME,var TDateTime):Boolean;
DSiWin32.pas(5902,12) Error: Not all declarations of "DSiFileTimeToDateTime" are declared with OVERLOAD
DSiWin32.pas(5906,44) Error: Incompatible type for arg no. 1: Got "FILETIME", expected "_FILETIME"
DSiWin32.pas(5908,47) Warning: Local variable "sysTime" does not seem to be initialized
DSiWin32.pas(5915,12) Error: function header doesn't match the previous declaration "DSiFileTimeToMicroSeconds(FILETIME):Int64;"
DSiWin32.pas(1102,13) Hint: Found declaration: DSiFileTimeToMicroSeconds(_FILETIME):Int64;
DSiWin32.pas(5962,52) Hint: Function result variable does not seem to be initialized
DSiWin32.pas(5994,45) Hint: Local variable "freq" does not seem to be initialized
DSiWin32.pas(5996,43) Hint: Local variable "endTime" does not seem to be initialized
DSiWin32.pas(5999,45) Hint: Local variable "nowTime" does not seem to be initialized
DSiWin32.pas(6088,30) Warning: Use of +offset(%ebp) for parameters invalid here
DSiWin32.pas(6582) Fatal: There were 17 errors compiling module, stopping

Benutzeravatar
d.oertel
Beiträge: 3263
Registriert: 04 Jun 2008, 14:27

Re: Compiling opsi-winst

Beitragvon d.oertel » 27 Jan 2015, 20:08

Hi,

sorry for the late intervention.

the opsi-winst has to be compiled by Lazarus/Freepascal
using the Libraries indy, dcpcrypt, lzrichedit.

The best way to start ist using the opsi lazarus package:
http://download.uib.de/opsi4.0/products/contribute/full-package/lazarus_1.2.6-1.opsi

If you try to solve the problem of the Thread: 'Requested products are not installed'
it will be time saving to just let me have a look at your log files.

But if you really want to compile your own opsi-winst:
start your lazarus
Install the needed packages:
Package / Package-Datei (*.lpk) öffnen
C:\lazarus\components\indy\indylaz.lpk
Einstellungen / Compiler Einstellungen /Pfade / Include-Dateien:
$(LazarusDir)\components\indy
Kompilieren
Nutzung / Installieren / Lazarus neu kompilieren

Package / Package-Datei (*.lpk) öffnen
C:\lazarus\components\thtml\htmlcomp.lpk
Einstellungen / Compiler Einstellungen /Pfade / Include-Dateien:
$(LazarusDir)\components\thtml
Kompilieren
Nutzung / Installieren / Lazarus neu kompilieren

Package / Package-Datei (*.lpk) öffnen
C:\lazarus\components\dcpcrypt\dcpcrypt_laz.lpk
Kompilieren
Nutzung / Installieren / Lazarus neu kompilieren

Package / Package-Datei (*.lpk) öffnen
C:\lazarus\components\lzRichEdit\lazrichedit.lpk
Kompilieren
Nutzung / Installieren / Lazarus neu kompilieren

Fertig

Lazarus winst

opsi-script souce code checkout
https://svn.opsi.org/opsi-winst/branches/4.11.4
project file is winst.lpi

regards

d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org

realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Re: Compiling opsi-winst

Beitragvon realflash » 29 Jan 2015, 11:08

Thanks for the information. I did (separately) manage to get it compiled in the end, by following the steps below. Could we have the readme.txt in the source code updated with some instructions, please?

I added more debugging to print the HTTP response of the config server to opsi-winst, and was able to confirm that the "wrong" information was coming from the config server. More on that in the other thread.

1. Install Lazarus from http://www.lazarus.freepascal.org
2. svn checkout http://lazarus-br.googlecode.com/svn/trunk/ lazarus-br-read-only
3. svn checkout https://svn.opsi.org/opsi-winst
4. Download Indy10_xxxx.zip from http://indy.fulgan.com/ZIP/
5. Run Lazarus
6. Click Project > Open project and navigate to tags/<version>. Double click on winst.lpi or winst64.lpi as appropriate
7. You should be prompted that LazRichEdit and indylaz packages failed to load. Click OK.

8. Click "Package > Open package file (.lpk)" and navigate to the lazarus-br-read-only repository you just checked out
9. Go into package/lzrichedit and double-click on lazrichedit.lpk
10. Click the Compile icon
11. Close the package window

12. Unzip the Indy10_xxxx.zip file you downloaded
13. Click "Package > Open package file (.lpk)" and navigate to Indy. Go into lib and open indylaz.lpk
14. Close the package window

15. Ctrl+F9 to build

Benutzeravatar
d.oertel
Beiträge: 3263
Registriert: 04 Jun 2008, 14:27

Re: Compiling opsi-winst

Beitragvon d.oertel » 29 Jan 2015, 12:48

Hi,

congratulation that you manged it (I think you are the first one in the community).
If you try to compile opsi-script for linux you need to use the patched indy library from the opsi package.
You may extract the lazarus opsi package with opsi-pacakgemanager -x
or 7-zip will help you to do this.

I will integrate a HowToBuild.txt in the opsi-winst 4.11.5 branch.

regards
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org

Benutzeravatar
d.oertel
Beiträge: 3263
Registriert: 04 Jun 2008, 14:27

Re: Compiling opsi-winst

Beitragvon d.oertel » 29 Jan 2015, 16:48

Hi,

another important remark on
or winst64.lpi

Don't do this.
opsi-winst for Windows is 32 right now.
The winst64 project is a reduced project for inside PE only and should be not used for any other purpose rigt now.

regards
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org