Online Package Manager
- 1 About
- 2 Using the package manager
- 2.1 Getting started
- 2.2 Filter the tree/Locate a package
- 2.3 Operation with packages
- 2.4 Create a private repository
Online Package Manager is a tool that automates the process of installing, upgrading, configuring Lazarus packages. The packages are stored in the main repository(see repository column) as zip files, along with a JSON file. The JSON contains all necessary information about the packages. On request the packages are downloaded/extracted/compiled/installed into the IDE. If available, it's also possible to update a previously installed package from the maintainer webpage(see update column). There's also a web version of the Lazarus Packages Repository available here: http://packages.lazarus-ide.org/.
Online package manager is part of Lazarus sources, in directory ($LazarusDir)/components/onlinepackagemanager.
To get the latest version:
From command line
Checkout: $ svn co http://svn.freepascal.org/svn/lazarus/trunk/components/onlinepackagemanager onlinepackagemanager
Update: $ svn up
With a SVN client
System Requirements / Dependencies
- FPC 3.0.0 or newer
- Lazarus 1.8 or newer
- You can download an older version for the 1.6 series: OPM 1.6
- These versions were available at the time of writing this update.
- Tested on the following widgeset: win32/64, gtk2, carbon, qt(win)
- The package manager does not depend on any external package
In Lazarus "Install/Uninstall Packages" window select "OnlinePackageManager" from the available packages, click "Install selection" and then rebuild the IDE.
Using the package manager
Go to Lazarus Menu-->Package-->Online Package Manager(Shortcut key: [Ctrl] + [Alt] + O). On startup the package manager will automatically download a list with available repository packages, the list is displayed in a tree(see screenshots above).
Filter the tree/Locate a package
You can filter the package list by:
- Package file(.lpk)-->a repository package can contain multiple lpk files
- Package category
- Package status
- Lazarus compatibility
- FPC compatibility
- Supported widget sets
Operation with packages
Refresh package list
Press the "Refresh" button to update the package list.
Check one or more package then press the "Download" button. This will download/extract the packages to a preselected directory. Nothing gets installed. Useful when you want to install the packages manually or study their sources without installing.
Install a package
Check one or more package then press the "Install" button. The package manager will automatically download/extract/compile/install the selected packages(from the main repository), then rebuild the IDE if necessary(Designtime/Designtime_and_runtime packages). Confirm the rebuild by clicking the "Yes" button. Please note: The compile feature is only available in Lazarus 1.7+.
Update a package
Check one or more package then press the "Update" button. The package manager will update the selected packages from the maintainer's homepage(if available). The package must be installed first, a direct update although is possible, is not allowed to prevent unresolved dependency error. Please note: downloading/installing packages from external link is not without a risk. Only update the package if you trust the package maintainer.
Difference between download/install/update
Download/Install --> Operations between you and the main repository.
Update --> Operations between you and the package maintainers.
Video link: Difference between download/install/update
Cleanup local repository
This operation will delete all non-installed packages/archives from the local repository. To cleanup the local repository press the "Cleanup" button.
This section is for package maintainers. First you must go to Options-->Profiles and select package maintainer.
Create repository package
To create a repository package press "Create repository package" menu item, then:
- select the package main directory(package manager will recursively search for all package files inside the folder)
- select the repository package(root node)
- choose category(obligatory)
- type display name(optional)
- home page(optional)
- update link(optional, for more details see "Create JSON for updates"" below)
- create JSON for updates(optional), has the same functionality as "Create JSON for updates"" dialog. It was also added here to speed up the process.
- check each package you wish to include, adjust package info if necessary(lazarus/fpc compatibility, supported widgetset, etc)
- press the create button, if all goes well you should get a zip and a json file. Upload somewhere the files and send the link to firstname.lastname@example.org or
- press the submit button, the files are directly uploaded to a remote server.
Every package will be accepted after a short check(malware, license, etc). Multiple versions of the same package is also allowed.
Create JSON for updates
To allow the user to update the package directly form your webpage, follow this steps:
- Make sure your package is already in the main repository(see previous section)
- You can download and use the Online Package Manager External Update json Editor
- or via OnlinePackageManager:
- Check the package, press the "Create JSON for upates" menu item then create the JSON.
- Edit the JSON, upload to your webpage, then send me the link.
The JSON will look like this:
Editable items in the JSON:
"DownloadZipURL" --> Link to your new, updated package
"DisableInOPM" --> If you want to temporary disable your package, set this boolean to true. It's useful for maintenance, the package will be grayed out in the tree. The user cannot download/install/update the package.
"Version"/"ForceNotify"/"InternalVersion" --> To trigger an update message on the users computer, you can either:
- Increase the "Version" number. Useful when you want to release a new version of the package.
- Set "ForceNotify" to true. Useful after a minor change in your source, that does not require a version change or in case of trunk version. To prevent continous error messages, "ForceNotify" must be used in combination with "InternalVersion". After the user updates the package, OPM locally stores the "InternalVersion" value. If you want to trigger a new message, increase "InternalVersion" with one. If "ForceNotify" is true, "Version" is always ignored.
The most common scenario is this:
- Generate the JSON
- Modify "DownloadZipURL"
- Increase version number when necessary.
Please note: After you edited the JSON the changes are not immediately visible in the tree. Usually it takes 1-2 min. It also depends on the users setting(Options-->General-->Check for package updates).
To display the options dialog press the "Options" button.
Create a private repository
Support for private repositories it's not fully implemented yet. However if you don't mind concatenate a few JSONs, you can create your own private repository. Please do the following: 1. Create one or more repository package. OPM will generate for each package a .zip and a .json file. 2. Concatenate the JSONs and create a single big JSON. Rename it to packagelist.json 3. Copy all the zip files and the packagelist.json to your server. 4. Set up the address for the private repository 5. Select the remote repository in the option dialog
Video link: Personal Repository