Recent

Author Topic: Laz AutoUpdate component - beta  (Read 63297 times)

balazsszekely

  • Guest
Re: Laz AutoUpdate component - beta
« Reply #105 on: January 26, 2017, 07:38:48 am »
Quote
I'd appreciate any ideas on how the console updater can ask permission in Linux to do its stuff.  It is launched as an AsyncProcess from the component code.  I just don't have the requisite Linux knowledge to do it.
I'd like to know how to determine if the console updater has enough rights under the current useraccount (which seems to be the issue) to overwrite an executable
Just set the execution permission for the console updater with the chmod command.  Chmod will ask for credentials when needed. Like this:
Code: Pascal  [Select][+][-]
  1. function SetExecutePermission(const AFileName: String; var AErrMsg: String): Boolean;
  2. var
  3.   SL: TStringList;
  4.   Process: TProcess;
  5. begin
  6.   Result := False;
  7.   Process := TProcess.Create(nil);
  8.   try
  9.     Process.Executable := '/bin/chmod';
  10.     Process.Parameters.Add('+X');
  11.     Process.Parameters.Add(AFileName);
  12.     Process.Options := Process.Options + [poWaitOnExit, poUsePipes];
  13.     Process.Execute;
  14.     SL := TStringList.Create;
  15.     try
  16.       SL.LoadFromStream(Process.Stderr);
  17.       AErrMsg := Trim(SL.Text);
  18.       Result := Trim(AErrMsg) = '';
  19.     finally
  20.       SL.Free;
  21.     end;
  22.   finally
  23.     Process.Free;
  24.   end;
  25. end;
  26.  
  27. procedure TForm1.Button1Click(Sender: TObject);
  28. var
  29.   ErrMsg: String;
  30. begin
  31.   if SetExecutePermission('/minesadorada/developer/updates/consoleupdater', ErrMsg) then
  32.     MessageDlg('Permission successfully set.', mtInformation, [mbOk], 0)
  33.   else
  34.     MessageDlg('Cannot set permission. Error message: ' + ErrMsg, mtError, [mbOk], 0);
  35. end;

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #106 on: January 26, 2017, 08:47:34 am »
@GetMem That's pretty much what I needed.  Thanks!
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #107 on: January 27, 2017, 01:08:19 pm »
Update to V0.3.4.0

* Added functions to make and delete a desktop shortcut (Linux implementation not yet functional)
* This is to help using LAU as an installer/updater
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Laz AutoUpdate component - beta
« Reply #108 on: January 28, 2017, 06:01:50 pm »
Update to V0.3.4.0

* Added functions to make and delete a desktop shortcut (Linux implementation not yet functional)
* This is to help using LAU as an installer/updater

I always was looking for an online setup tool, and never find one easy to deploy (or free), so this may be the case now with your tool, the first working. Also I did a google search and I find your wiki entry, so this can be more than a simple update tool. It can be a powerfull cross platform installer tool.

balazsszekely

  • Guest
Re: Laz AutoUpdate component - beta
« Reply #109 on: January 28, 2017, 07:19:40 pm »
Updated in the main repository to 0.3.5.0

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #110 on: January 28, 2017, 09:11:13 pm »
V0.3.5.0: Linux desktop icon creation should be working.  I need to install a proper Linux environment to test - all I have ATM is a broken Mint 32-bit installation and a LiveCD Puppy Linux 64-bit (which doesn't keep to standards)

The Tray (silent) updater seems to be working well.

Still working on the component though.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #111 on: January 29, 2017, 09:58:38 am »
Update to V0.3.6.0

There was a bug in V0.3.5.0 Windows MakeShortcut which caused a SegFault - now fixed.

@Getmem - please use V0.3.6.0 for the repository base - it is the most stable version.

ToDo: A generic installer/updater test app which uses both SourceForge and GitHub sources.  Also UpdatePack needs a few fixes.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

balazsszekely

  • Guest
Re: Laz AutoUpdate component - beta
« Reply #112 on: January 29, 2017, 11:03:08 am »
Quote
@Getmem - please use V0.3.6.0 for the repository base - it is the most stable version.
Done. Now the default version is V0.3.6.0.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #113 on: January 29, 2017, 01:42:33 pm »
To V0.3.7.1

* A few tweaks to get an installer working properly (New property: WorkingMode=(lauInstall|lauUpdate)
* If the app is absent: Install it.  If the app is present or running: Update it.
* Works in Windows OK.
* Testing app in SVN (work-in-progress)

* Windows version (alpha) is here: https://sourceforge.net/projects/lazautoupdate/
« Last Edit: January 29, 2017, 02:53:00 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #114 on: January 30, 2017, 10:34:10 am »
To V0.3.8

* MakeShortcut now makes a menu entry as well as a desktop shortcut in Windows
* Updated Installer app (and wiki docs)
* Updated Update Pack

With Property WorkingMode, your main app can:
* Update itseslf (WorkingMode=lauUpdate)
*  (WorkingMode=lauInstall) Install other apps programmatically (perhaps via a menu) which can also update themselves (WorkingMode=lauUpdate)
* All functionality automatically updates the TrayIcon app

With the TrayIcon app:
* Runs in the background, and silently checks and updates apps on a developer/user defined schedule (daily, weekly, monthly etc)
* When an update is done via LazAutoUpdate anywhere, the TrayIcon app picks it up automatically

ToDo: Improve the updating visually with a progress bar

Available via:
 https://sourceforge.net/projects/lazautoupdate/
svn: Lazarus ccr: https://svn.code.sf.net/p/lazarus-ccr/svn/components/lazautoupdate/latest_stable
OnlinePackageManager: http://packages.lazarus-ide.org/
Wiki page: http://wiki.lazarus.freepascal.org/LazAutoUpdater
« Last Edit: February 13, 2017, 10:31:41 am by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #115 on: February 13, 2017, 10:27:03 am »
Updated Wiki with info about the Systray Updater companion app.  If you deploy an app with LazAutoUpdate consider also deploying the Systray Updater.  It will silently check for updates on a schedule and optionally silently update your app when it finds a newer version.  When an app is manually updated (via normal LazAutoUpdate), the systray app config file is automatically configured.  Runs under Windows or Linux,

It is designed for 'deploy once then forget' when run on Windows startup.

Wiki page: http://wiki.lazarus.freepascal.org/LazAutoUpdater
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

mdbs99

  • Full Member
  • ***
  • Posts: 121
  • Software Engineer. Husband. Trader.
    • website
Re: Laz AutoUpdate component - beta
« Reply #116 on: May 22, 2017, 01:53:37 am »
Hi @minesadorada

Why we have 2 options to get the sources?

1. https://sourceforge.net/projects/lazautoupdate/
2. https://svn.code.sf.net/p/lazarus-ccr/svn/components/lazautoupdate/latest_stable

Which one is official?

Thanks.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #117 on: May 22, 2017, 09:45:16 am »
Hi @minesadorada

Why we have 2 options to get the sources?

1. https://sourceforge.net/projects/lazautoupdate/
2. https://svn.code.sf.net/p/lazarus-ccr/svn/components/lazautoupdate/latest_stable

Which one is official?

Thanks.
Hi @mdbs99,
The CCR source is the one used by Online Package Manager, my own CVS source control and has the latest code.
The sourceforge site is a mirror, and is used for LazAutoUpdate's own updater, as well as compiled versions/installers etc.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

mdbs99

  • Full Member
  • ***
  • Posts: 121
  • Software Engineer. Husband. Trader.
    • website
Re: Laz AutoUpdate component - beta
« Reply #118 on: May 22, 2017, 02:03:19 pm »
Ok, I already have CCR sources so, I'll use it.

I didn't install yet, but I have one question (forgive me if is a dumb question).
I would like to use LazAutoUpdate (LAU) this way:
I will put my binaries in my server and configure LAU to check the binaries in the program initialization. If my server has a new version, the program should advise the user (I need to configure my own message) and abort. I mean, the user is not allow to use a old version, for secure reasons.

Is it possible to use like that?

Thank you.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Laz AutoUpdate component - beta
« Reply #119 on: May 22, 2017, 05:48:24 pm »
Ok, I already have CCR sources so, I'll use it.

I didn't install yet, but I have one question (forgive me if is a dumb question).
I would like to use LazAutoUpdate (LAU) this way:
I will put my binaries in my server and configure LAU to check the binaries in the program initialization. If my server has a new version, the program should advise the user (I need to configure my own message) and abort. I mean, the user is not allow to use a old version, for secure reasons.

Is it possible to use like that?

Thank you.

Take a look at the wiki page:
http://wiki.freepascal.org/LazAutoUpdater

There is a boolean function:

Code: Pascal  [Select][+][-]
  1. If LazAutoUpdate1.NewVersionAvailable then ..... else ...

which I think will suit your need.   It downloads a very small text file with the newest online version number and compares it with the VersionInfo information of your application.

If newer (returns TRUE), you can use the functions:

Code: Pascal  [Select][+][-]
  1. If LazAutoUpdate1.DownloadNewVersion then LazAutoUpdate1.UpdateToNewVersion

which will overwrite the old application with the new.

Set the property ShowDialogs=False in order to have full control of the UI.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

 

TinyPortal © 2005-2018