Recent

Author Topic: Onguard Win64  (Read 34389 times)

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Onguard Win64
« Reply #15 on: February 07, 2014, 04:52:23 pm »
Seems to be time to make a donation instead of buying another version of Delphi
We gave up Delphi back in 2006 - never looked back and never regretted it either. Free Pascal is a fantastic compiler, and Lazarus IDE is a great development tool.  The amount of money we saved is incredible, and the flexibility open-source development tools give is just amazing. I can't imagine anything different.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #16 on: February 24, 2014, 09:36:37 am »
Hi, Graeme!
There are two packages here: tponguard.lpk and tponguard_design.lpk.
tpongurad.lpk is run-time only? No installation needed?
Which-one to use normally?
 Compilation of run-time tponguard - no problem, but when trying to compile and install tponguard_design.lpk, I get error:
Quote
tponguard_design.pas(10,5) Fatal: Can not find unit ogreg used by tponguard_design. Check if package tponguard_design is in the dependencies.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Onguard Win64
« Reply #17 on: February 24, 2014, 02:28:02 pm »
There are two packages here: tponguard.lpk and tponguard_design.lpk.
tpongurad.lpk is run-time only? No installation needed?
Which-one to use normally?

tponguard.lpk Is a runtime only package which means it is not dependent on any GUI toolkit etc, so can be used in web pages, console apps, other non-LCL programs etc.

tionguard_design.lpk Is a design time package, which is used to install and register components on the Lazarus IDE component palette. Thus it has a Lazarus LCL/IDE dependency.

I normally use the runtime-only package only. Simply add it as a dependency to any project. It will be compiled by Lazarus IDE when required, but will not be installed on the component palette toolbar.

I'll take a look at the error you get on the design time package. I restructured the directory layout, so might have broken the paths to some files. Should be a quick and easy fix.  Thanks for bringing this to my attention.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #18 on: February 24, 2014, 03:01:02 pm »
There are two packages here: tponguard.lpk and tponguard_design.lpk.
tpongurad.lpk is run-time only? No installation needed?
Which-one to use normally?

tponguard.lpk Is a runtime only package which means it is not dependent on any GUI toolkit etc, so can be used in web pages, console apps, other non-LCL programs etc.

tionguard_design.lpk Is a design time package, which is used to install and register components on the Lazarus IDE component palette. Thus it has a Lazarus LCL/IDE dependency.

I normally use the runtime-only package only. Simply add it as a dependency to any project. It will be compiled by Lazarus IDE when required, but will not be installed on the component palette toolbar.

I'll take a look at the error you get on the design time package. I restructured the directory layout, so might have broken the paths to some files. Should be a quick and easy fix.  Thanks for bringing this to my attention.
ok, please note, this is CodeTyphon Lazarus distribution, version 4.70.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Onguard Win64
« Reply #19 on: February 24, 2014, 03:07:46 pm »
ok, please note, this is CodeTyphon Lazarus distribution, version 4.70.
Shouldn't make any difference. As far as I know CodeTyphon is just a rebranded Lazarus and with some mods and lots more 3rd party components.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Onguard Win64
« Reply #20 on: March 07, 2014, 10:29:11 am »
The version of OnGuard you used is out of date. For the purposed of my work and customers, I started to maintain my own version of OnGuard. It can be found here:
  https://github.com/graemeg/onguard

I can confirm that it does work on 32-bit and 64-bit Windows,Linux and FreeBSD.
Updated the wiki at
http://wiki.lazarus.freepascal.org/OnGuard#Alternative_version
of course, please feel free to correct the article etc.

Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Onguard Win64
« Reply #21 on: March 08, 2014, 06:03:39 pm »
I updated the design time package (Github repository), so the source paths now point to the correct source locations. The package now compiles and installs without problems into Lazarus IDE and the component palette.

Sorry about the inconvenience. I reorganised the directories a while back, but forgot to amend the paths in the design time package.

https://github.com/graemeg/onguard
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #22 on: March 08, 2014, 06:35:20 pm »
Hi, Grame!
I think you should add Include path in the package general options. That's for onguard.inc file...

Anyway,
I wanted to make a customized code generator for my program, in the way it is done in CODEGEN example. For instance, I'd like to open CodeGenerateFrm with serial number page sheet, my program's key set, machine modifier chek box checked etc.

For some reason, I can't change any of the CodeGenerateFrm properties in runtime?
Why I can't change properties of the  CodeGenerateFrm after it is created by executing OgMakeCodes1.Execute?


Code: [Select]
procedure TCodeGenFrm.GenerateBtnClick(Sender: TObject);
const

  CKey:TKey=(..Here is Some Key...);

var
  Work : TCode;
begin
  {set default key to use}

  OgMakeCodes1.SetKey(CKey); //this works
  OgMakeCodes1.CodeType:=ctSerialNumber;//this works

  if OgMakeCodes1.Execute then begin
    //Set some properties to the code-generation form
    //Nothing happens when properties changed in the generated form?
    CodeGenerateFrm.TabSheet1.TabVisible:=False;
    CodeGenerateFrm.CodesNbk.ActivePage:=CodeGenerateFrm.TabSheet2;
    CodeGenerateFrm.NoModifierCb.Checked:=False;
    CodeGenerateFrm.MachineModifierCb.Checked:=True;
    CodeGenerateFrm.Caption:='trlababalan';

    {get the code}
    OgMakeCodes1.GetCode(Work);
    {display the code}
    CodeEd.Text := OgUtil.BufferToHex(Work, SizeOf(Work));
  end;

end;                                               
« Last Edit: March 08, 2014, 06:55:56 pm by tatamata »

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #23 on: March 12, 2014, 10:00:19 am »
I couldn't figure-out why I can't customize design package forms after calling OgMakeCodes Execute method, so I made my own form for code generator....

Anyway, thanks to Graeme, I successfully integrated tponguard into my program. Grame, thank you for keeping this package alive.

However, I would point to some minor issues which I came accross:
1. I'm working in Linux, but cross-compile program for Windows. When I wanted to cross-compile, an error appeared about missing idesn unit. This unit is required only in Windows. So I had to add it to the package. However, when going back to Linux compilation, now error appears because of idesn unit, which is only for Windows, so I had to remove it from package again...Well, not very convinient...Since I don't have Windows machine, I don't know how it behaves when installed in Windows...
2. ogfirst unit for single-instance application is not included. Is this intentionally? I mean, there is LuiControls with its UniqueInstance component, which is working very good, but, still, it would be good to have alternative...

Regards

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Onguard Win64
« Reply #24 on: March 12, 2014, 02:11:21 pm »
Quote
This unit is required only in Windows.

Why dont you use : ?
Code: [Select]
uses
{$ifdef windows}
idesn,
 {$endif}
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #25 on: March 19, 2014, 10:56:27 pm »
Quote
This unit is required only in Windows.

Why dont you use : ?
Code: [Select]
uses
{$ifdef windows}
idesn,
 {$endif}
Hi! It's already in onguard.pas ifedefed:
Code: [Select]
{$IFDEF WIN32}
  ,idesn
{$ENDIF}
I have just finished a program in Linux and tried to cross-compile it for Windows.
I addend idesn.pas to the tponguard package as last time, recompiled package, but this time I can't compile the project...
What ever I do, I get error: "
Quote
unit10.pas(0,0) Fatal: Can not find idesn used by onguard, ppu=/usr/lib/codetyphon/typhon/components/onguard-master/packages/lib/i386-win32/Idesn.ppu, package tponguard
"
I don't understand this...How it can't find the unit when the unit is added to the package?

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #26 on: March 19, 2014, 11:03:05 pm »
Quote
This unit is required only in Windows.

Why dont you use : ?
Code: [Select]
uses
{$ifdef windows}
idesn,
 {$endif}
Hi! It's already in onguard.pas ifedefed:
Code: [Select]
{$IFDEF WIN32}
  ,idesn
{$ENDIF}
I have just finished a program in Linux and tried to cross-compile it for Windows.
I addend idesn.pas to the tponguard package as last time, recompiled package, but this time I can't compile the project...
What ever I do, I get error: "
Quote
unit10.pas(0,0) Fatal: Can not find idesn used by onguard, ppu=/usr/lib/codetyphon/typhon/components/onguard-master/packages/lib/i386-win32/Idesn.ppu, package tponguard
"
I don't understand this...How it can't find the unit when the unit is added to the package?
Oh, when I renamed "Idesn.ppu" to "idesn.ppu", now it seems it is working...

stoppok

  • New Member
  • *
  • Posts: 18
Re: Onguard Win64
« Reply #27 on: March 19, 2014, 11:24:36 pm »
Hi Graeme,

I'm now integrating OnGuard source from your repository into my project and found a problem with TOgDaysCode (and possibly TOgDateCode): It's very simple to fool the check because the implementation of  "InvalidCount" is not correct. I found the source of the problem in IsDaysCodeValid:

...
  if (not Result) and (Work.InvalidCount >0) then Result := true;
...

If somebody can manipulate the Code (e.g. in Ini-file)  then Work.InvalidCount will get some other value then expected and it will be > 0 very very often.

I'd recommend to remove this feature, makes not much sense to me.


tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Onguard Win64
« Reply #28 on: March 20, 2014, 12:24:42 am »
Hi Graeme,

I'm now integrating OnGuard source from your repository into my project and found a problem with TOgDaysCode (and possibly TOgDateCode): It's very simple to fool the check because the implementation of  "InvalidCount" is not correct. I found the source of the problem in IsDaysCodeValid:

...
  if (not Result) and (Work.InvalidCount >0) then Result := true;
...

If somebody can manipulate the Code (e.g. in Ini-file)  then Work.InvalidCount will get some other value then expected and it will be > 0 very very often.

I'd recommend to remove this feature, makes not much sense to me.

Hi, stoppok!

Many thanks posting this! I think you are right.
I was just twitching my hair - I was tested trial release code (days code) previous days and everything seemed to be OK, so I didn't look at it again. But, when I looked at it now, suddenly the program's log said: "Trial release code is valid!
Trial release code is: A97AD6950BC9BAA2FD19
Trial period is valid!
--> Trial days left: 35343
--> Trial expiration date: 01.01.9999", although trial period should have ended few days ago :o! :'(

When I commented the code in IsDaysCodeValid, as you suggested, now it seems to be OK again.

Brrr...very dangerous!

Can somebody else confirm this bug? Graeme?

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Onguard Win64
« Reply #29 on: March 20, 2014, 04:26:23 pm »
If somebody can manipulate the Code (e.g. in Ini-file)  then Work.InvalidCount will get some other value then expected and it will be > 0 very very often.

I'd recommend to remove this feature, makes not much sense to me.
I see what you mean. Thanks for pointing this out. I have modified the OnGuard code to not check the Work.InvalidCount any more. That was a silly feature/idea to start with.

Github repository has been updated.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018