Qt RPM Package (Un-)Installer GUI Frontend for Windows, Mac OS X, and Linux

The goal of this project is to create a GUI, using C++/Qt4, that presents the (un-)install process of .rpm files using the 'rpm' program, which is available for Linux, Mac OS X, and Windows.

You will require an understanding of Qt, UNIX and Windows filesystems, and some background with software (un-)installation on the three platforms would be useful.

## Deliverables

This installer will be used for installing software, libraries, and data from specially-constructed .rpm packages on Windows, Mac OS X and Linux.

Even on systems with an RPM-based package manager already, this installer will use it's own RPM database - not the system's - for all of the software it installs and removes, and will ship with its own 'rpm' executable for Linux, Mac OS X and Windows (as [url removed, login to view], using version 3.0.6 from the Cygwin RPM project on Sourceforge. The latest version available through the Cygwin setup program, 4.1, should _not_ be used, as it has problems with relocations). The program should construct this database before performing its first installation, the first time that it executes (using the --initdb argument).

The program will have configuration data that is separate from this package database, and this should be stored and queried using the QSettings interface provided by Qt. The program's own RPM database should be stored in the same directory used to store these settings (and so, even under Windows, the QSettings::IniFormat should be used). The rpmrc file set with the --rcfile argument should refer to a customised macros file that sets _dbpath to point to this directory. All of these files can be created or customised for the user at the time the program is first launched (this being done should not disturb the user's interaction with the GUI, so should be done in a separate thread, along with the --initdb. While this is running, the user will need to wait to perform any installations, but the rest of the GUI should still be interactive). The program should store it's settings per user, not system wide.

Included with this requirements document is a PDF presenting the expected layout of the software

By passing the --percent argument to the 'rpm' program, it will output messages of the form "%% <percentage>", where <percentage> is a real number in the range [0.0, 100.0]. The GUI's progress bar for the current installation will be updated based on this output. This --percent argument may only be specified for package installations, so another visual indication that the uninstall is running will be needed (it doesn't need to show percentages). To keep install and uninstall consistent, an oscillating rectangle inside the progress bar would be effective, with the same colour/style as the contents of a typical progress bar. If the same style can not be achieved consistently on all platforms on which the software is available, then some other method of displaying activity should be used.

If a package contains files which are to be installed to a system directory, rather than a private user directory, it will need to provide a dialog in which the user installing the package may input the password for the system's administrator account (or 'root,' under Linux/OS X). This can be determined before installing the rpm using the "rpm -qlp <package file>" command, which will print out the paths of everything in the package.

At installation time, the install paths for the contents of these packages will be modified based on the installer's current configuration. The rpm command provides the --relocate argument, which can be used for this purpose. The file paths in packages that are constructed to be installed using this software will include one of two standard prefixes to be passed to this argument.

Files with the INSTALLERSINGLEPREFIX will be installed to a directory according to the installer's current setting for the install destination. Files with the INSTALLERMULTIPREFIX will be installed to the 'root' of the filesystem. This will be '/' under Linux and Mac OS X, but will take more work to determine under Windows, since it does not have a single root.

Under Windows, the installer should default to the same installation drive as used by the Windows Installer. I think this is determined by finding the drive letter with the most free space. Under Windows only, the installer should provide a combo box in the preferences that will list the system's partitions, and allow the user to select the partition to be used for installations. If the user does not set a partition, the installer should determine which one to use during at the start of each package install (and not only once when the installer is first launched, because the free space on each partition could change fairly often).

One of these prefixes is to be used for installations that keep all of their files underneath a single directory in the filesystem hierarchy. The other prefix is to be used for installations that split their installed files into locations underneath multiple directories in the FS hierarchy.

The installer may be configured to install to a system directory, in which case the NEWPATH part supplied to the --relocate argument will be '/' (for the first type of OLDPATH) or '/usr/local/' (for the second type of OLDPATH) under Linux/OS X or the system 'Program Files' directory under Windows, or if it is configured to install to the user's private directory, it will be '<Config>/Install/' (where <Config> is the installer's configuration directory (as determined by QSettings)) under Linux/OS X (for both types of OLDPATH) and the User's own 'Program Files' directory under Windows.

All packages installed with the installer will have the their file paths with the appropriate directory names. So, for example, if the package is for a program called 'test' then all file paths would start with something like "/INSTALLERSINGLEPREFIX/test" and the "test" part would not have to be included in the NEWPATH part of --relocate.




The application's interface design is presented in detail in both the PDF and video included in the 'attached' archive.

Preferences dialog


The preferences dialog only controls one configuration option - where packages are to be installed. The dialog provides a choice between three items, styled as radio buttons:

- "To my own user account"

This is the configuration that the installer defaults to. When this is selected, the installer will relocate packages with the INSTALLERSINGLEPREFIX to a private directory associated with the user's account. This will depend on the current platform, but QDesktopServices::ApplicationsLocation may be useful. This seems to return an empty return an empty string under Linux, so on this platform a good default would be ~/Packages (where ~ is expanded to the user's home directory). If QDesktopServices::Applications doesn't give an empty location, then the application should default to a subdirectory 'Packages' of the returned location. For this option, only a location that the user has write access privledges to may be selected.

- "System-wide"

When this is selected, the installer will relocate packages with the INSTALLERSINGLEPREFIX to a publicly-accessible system directory. This will probably default to the system-wide 'Program Files' directory under Windows, /usr/local/bin under Linux, and the system-wide applications directory under Mac OS X

- "For everything I install, ask me where to put it"

The dialog also contains a button, "Set Exact Locations," that is enabled when either "To my own user account" or "System-wide" is selected, and disabled when "For everything I install, ask me where to put it" is selected. When clicked, this will bring up one of the dialogs presented on pages four and five of the included PDF ("User Account Locations Dialog" or "System-wide Locations Dialog") depending on which radio-button has been clicked. If "to my own user account" has been selected, the "User Account Locations Dialog" will be shown, if the "System-wide" has been selected, the "System-wide Locstions Dialog" will be shown.


User Account Locations Dialog


The locations available in the drop-down box of this dialog will be:

- The Install/ subdirectory of the installer's configuration directory (where the QSettings are stored)

- The directory mentioned under "To my own user account" in the previous section ("Preferences dialog")

- "Choose other location..." - When this option is selected in the drop-down box, a QFileDialog will be presented that the user may choose a directory from. If the user selects a directory in the file dialog that their user account does not have access rights to, the currently-selected install directory will not be changed, and the GUI will present a warning that "To install to the selected location, you will first need to choose the "System-wide" option in the preferences, and supply an administrator password during package installs."


System-wide Locations Dialog


The locations available in the drop-down box of this dialog will be:

- The directory mentioned under "System-wide" in the "Preferences dialog" section (for the appropriate platform).

- "Choose other location..." - When this option is selected in the drop-down box, a QFileDialog will be presented that the user may choose a directory from.


Main window


The main window of the application, presented on five pages - "Main Window - Install New Packages Tab," (1) "Existing Packages Tab," (2) "Package-Specific Locations Page," (6) "Authentication Page," (7) and "Alternative Authentication Page" (8) - of the included PDF, consists of:

- A menu bar with File and Edit menus. The File menu contains a single item, 'Quit', and the Edit menu also contains a single item, 'Preferences.'

- A tab widget, of which the first page, "Install New Packages" is shown, this page contains:

- An embedded collection of pages (documented on pages 1, 6, 7, and 8 of the PDF). Depending on the packages being installed, and the current configuration; one, two, or all three of these pages may be navigated through during the package install process. These are documented in the subsection 'Install New Packages Subpages'.

- The second page of the tab widget, 'Existing Packages,' presented on the "Main Window - Existing Packages" page of the included PDF, contains:

- A list of all the packages that have been installed by the application (probably retrieved by parsing the output of the command "rpm -qa")

- A 'Remove' button, enabled when a package in the list is selected, and disabled otherwise, that - when clicked - removes the selected package from the system.


Install New Packages Subpages


Depending on the package(s) being installed and the installer's current configuration, different pages of the interface may be shown.

For all package installs, the "Select Packages" page will be shown. The layout of this page is presented on page 1 of the included PDF ("Main Window - Install New Packages Tab"). It contains:

- At the top is a button which may later be used to navigate to this page during an install. This button will be further described in the "Serial Button Group" section. The button here is labelled "Select Packages" and, initially, is disabled.

- A list of packages being installed in the current session. This list contains two columns. In the first column, the name of the package to be installed is shown, and in the second column will be some indication of the install status.

When a package is added to the list, it will have the text "To be installed..." shown in the 'Status' column. When the installation has started, the column will either show "Installing..." or - if available - the current progress of that package's install, as determined from the output of the rpm program (using the --percent argument) will be shown by a progress bar. If the RPM command fails to install for any reason, an error message will be shown in the status column. Such an error could occur if the package is already installed, or is missing one or more dependencies. If the installation succeeds, the package should be removed from the list (and should now appear in the "Existing Packages" page, described previously).

- An 'Add Package(s)' button. When pressed, this will launch an 'Open File(s)' dialog, that will allow the user to select zero or more .rpm packages to install. Using the file paths returned by the dialog, the application will add items for these packages to the list of packages to be installed.

- A 'Remove Package' button. When no package in the list of packages to be installed has been selected, this button will be disabled, When a package has been selected, it will be enabled, and clicking it will remove the selected package from the list.

- An 'Install' button. This button will be disabled when there are no packages in the list, and enabled when one or more packages are in the list. When clicked, one of the following may happen.

- (1) If the program has been configured to install to a directory of the user's account (discussed in the section "Preferences Dialog"), and none of the selected packages contain the INSTALLERMULTIPREFIX, _or_ if none of the packages with that prefix would install their to a directory that the user doesn't have access rights to, then the application won't show any of the other pages, and it will use the rpm program to try and install the packages in the list, updating their status as noted previously. When packages are being installed, the "Select Packages" button should be temporarily renamed to "Installing packages...". This is the simplest kind of install.

- (2) If the application is configured to ask the user where to put the contents of the packages they install (the third radio button shown on page 3, "Preferences Dialog" of the included PDF), then the subpage shown on page 6, "Package-specific Locations Page", of the included PDF, will be brought up.

- This includes a list similar to that on the "Select Packages" subpage. All packages with the INSTALLERSINGLEPREFIX will be shown in the list (any packages containing an INSTALLERMULTIPREFIX should not be shown), with their name in the first column. The second column will show the directory under which that package will be installed. This should default to the same directory as would be used if the "To my own user account" radio button was selected in the "Preferences" dialog (page 3 of the included PDF). When this column is selected though, the user will be presented with a drop-down box that they can use to select a destination directory. This drop-down box will contain a few options to choose from.

- The directory that was first defaulted to.

- The directory that would be used if the "System-wide" radio button was selected in the Preferences dialog.

- "Choose other location..." - When this option is selected in the drop-down box, a QFileDialog will be presented that the user may choose a directory from.

- Below this list, and towards the right side of the subpage, is a "Continue Installing" button.

- If all packages to be installed can be installed without administrator priviledges, then the installer will change to the "Select Packages" subpage, and proceed with the installation as described under behaviour (1) described above.

- If installing any packages will require administrator priviledges, then the "Enter Password" subpage will be shown (as presented on page 7 ("Enter Password Page") of the included PDF. The layout and behaviour of this subpage is described in the note marked (3), next.


- (3) If for any other reason an administrator password is needed to install the selected packages, then the "Enter Password" subpage will be shown (as presented on page 8, "Alternative Enter Password Page," in the included PDF). This subpage consists of:

- A text field for entering a password. The echo mode should be set to QLineEdit::Password, like a typical password field.

- An button, always enabled (since an empty password is possible in some situations). If a single package is being installed, then this should say "Install Package" or if more than one package is being installed, it should say "Install Packages". When clicked, the program should be authenticated with the OS for installing selected packages using the rpm program as described in note (1), above. If authentication fails (the user entered an incorrect password, for example), in the area of the dialog with "<Possible Incorrect Password Message>" the application should say "The entered password is incorrect, please try again." and the application should set input focus to the password line edit, hilighting all of its contents, so that any entered text will replace the old contents, and not be appended to the end of it.

- In the layout in the included PDF, there is a segment of text marked "<Configurable Message>" What this says will depend on the number of packages being installed. If there is a single package being installed, it should say "To install this package", otherwise - if there is more than one being installed - it should say "To install these packages".


Serial Button Group


What I have called a "Serial Button Group" is used on the subpages of the "Install New Packages" tab. The behavior of these buttons is similar (but _not_ identical) to what is shown in the included video, "Serial [url removed, login to view]".

Depending on which subpages are shown during an install process, different buttons will be shown in the button group. The orders of pages that may be shown are:

- Select Packages

- Select Packages -> Choose Locations

- Select Packages -> Enter Password

- Select Packages -> Choose Locations -> Enter Password

The button group will only include a button for a page once that page is viewed. In other words, if an install process included all three pages for example, each step's button would only be revealed as that step was reached.

If a password is required for the selected packages, for example, the "Enter Password" button in the group would only be revealed once the user had clicked on "Install" in the "Select Packages" page or "Continue Installing" in the "Choose Locations" page.

Once a subpage has been revealed, the user may navigate between all of the other subpages using the buttons in this button group. Unlike what is shown in the video, the button group will not collapse when a previous button is selected. The button group will only collapse in to one button (if there was more than one subpage shown) when the program is actually installing the selected packages (and the "Select Packages" button is renamed to "Installing packages..." temporarily).

The currently selected subpage's button is shown with bold text, all of the other buttons in the button group should have the regular font.

Also unlike the video, there are no 'back' and 'forward' buttons shown in this interface.


Miscellaneous Interface Notes


If an install process consists of more than a single subpage, and the user has not yet clicked on the button on the final subpage, then the user should still be able to add to and remove from the packages selected to be installed.

This means that if a package is removed from the "Select Packages" subpage list, and it was shown in the list on the "Choose Locations" subpage, it should be removed from this list, too.

If a package is removed, and the leftover packages(s) do not require an administrative password to install, the button group should be collapsed so that the "Enter Password" subpage is not shown anymore (if the "Choose Locations" subpage was shown, it's button should still be in the button group beside "Select Packages").

If a package is added to the "Select Packages" subpage list, and it should be shown in the "Choose Locations" subpage list (it has the INSTALLERSINGLEPREFIX prefix), then it should also be added to that list.

The "Install," "Continue Installing," and "Install Package(s)" buttons on the three subpages, when clicked, should only ever progress to the immediately following stage of the install, even if the final stage of the install has already been reached. For example, if the user has gone through the "Select Packages" -> "Choose Locations" -> "Enter Password" subpages, but not yet clicked on "Install Package(s)" and then goes back to the "Select Packages" subpage (using the first button in the button group), then clicking on the "Install" button on this page should go to the "Choose Locations" subpage again, and not to the "Enter Password" subpage. The only way to go directly from the "Select Packages" subpage to the "Enter Password" subpage would be to click on the "Enter Password" button in the button group within the "Select Packages" subpage.

Clicking on a button in the button group for the current page should not have any effect (a no-op). It should not be disabled/greyed out, it should just do nothing when clicked.


Custom Script Interpreter


Scripts included within an .rpm file that can be run during an install or uninstall (for example, those specified with @pre and @post in the SPEC file used to generate the file) may be written to use a custom interpreter (using the -p argument in the SPEC file).

To take advantage of this, the application should be delivered with a python interpreter for each platform that it runs on. To be able to use a script interpreter with the rpm executable, the interpreter needs to be included in the rpm database (because RPMs that use a custom script interpreter automatically get a Requires: line when built with rpmbuild). This can be achieved by creating a virtual package for the python interpreter delivered with the application, and installing this virtual package immediately after the database is first initialised (with --initdb, as mentioned earlier).

Kemahiran: Pengaturcaraan C, Kejuruteraan, Linux, Mac OS Mac OS, Microsoft, Pengurusan Projek, Memasang Skrip, Skrip Kekerang, Kejuruteraan Perisian, Ujian Perisian, Destop Windows

Lihat lagi: package windows, design install, may specified package installation, install rpm local packages gui, x interactive, write my name in style, work from home for disabled, work from home disabled, work at home entering data, work at home disabled, words with the prefix in, words with the prefix a, words with number prefixes, words that have the prefix be, windows gui programming, windows 8 programming, window design group, widget manager, where to start programming, where is my package

Tentang Majikan:
( 11 ulasan ) Auckland, New Zealand

ID Projek: #3875086

3 pekerja bebas membida secara purata $2380 untuk pekerjaan ini


See private message.

$765 USD dalam 14 hari
(31 Ulasan)

See private message.

$5950 USD dalam 14 hari
(0 Ulasan)

See private message.

$425 USD dalam 14 hari
(0 Ulasan)