Jump to content

Wikipedia:WPCleaner/Installation

From Wikipedia, the free encyclopedia
WPCleaner – 2.05 (August 26, 2022 (2022-08-26)) [±]
WPCleaner

General information about WPCleaner

Discussion

Discuss the application

Typos

Suggestions for spelling and typography

FAQ

Frequently asked questions

Installation

Install instructions

Bug report or feature request · History of changes · Configuration (help, template) · Wikis · Languages · Users · Screenshots

WPCleaner is a maintenance tool, developed with Java 8+. The installation program is hosted on Toolforge since release 2.0 of WPCleaner.[n 1] The minimum required version is Java 8, and it should run with any later version.

Prerequisites

[edit]

Prerequisites to install and use WPCleaner are:

Installation with WPCleaner installer

[edit]

The easiest way to install WPCleaner is with the dedicated installation program (Note: currently, the installation program has only been tested on a small number of computers running a Windows or Ubuntu operating system, so please report any result with your installation on WPCleaner's talk page).

The following actions are required to install WPCleaner:

  • Download the installer from WMFLabs (don't worry if there's a warning, .jar files are supposed to be executable files)
  • Run the installer (if Java is correctly installed and configured, opening the downloaded jar file should run the installer[1])
  • Provide the required information for the configuration:
    • Installation folder: select the folder where WPCleaner will be installed. Note: Avoid selecting a folder inside a folder protected by specific rights (like C:\Program Files or C:\Program Files (x86) on Windows).
    • Wiki: the wiki you would like to connect to by default.
    • Language: the language in which you would like to use WPCleaner.
    • Username: your username (optional).
    • Password: your password (optional).
    • Choose if you want the installer to create a shortcut for WPCleaner. If the username and password have been provided, this shortcut will start WPCleaner with the given credentials. Note: Creating a shortcut only works for a few operating systems.
    • Choose if you want to install the beta version of WPCleaner (select this option only if you want to check beta features of WPCleaner)
  • Click on Install and wait for the installation to complete.[2]

Note: This procedure is a wrapper for the installation with getdown, so the automatic updating of WPCleaner will be handled by getdown.

Installation with getdown

[edit]
Installation tutorial on Windows 10

Another way to install WPCleaner is with getdown, an independent tool dedicated to installing and automatic updating of Java programs. This installation lets you automatically update WPCleaner at each execution.

The following actions are required to install WPCleaner:

  • Create a dedicated folder for WPCleaner (noted as [Path] in the explanations). Note: Avoid creating this folder in a folder protected by specific rights (like C:\Program Files or C:\Program Files (x86) on Windows).
  • Download the following files and place them in this folder:
    • getdown.txt (if your browser displays the file contents instead of suggesting you to save the file locally, you can try right-clicking on the link and use an option like "Save link as...")
    • getdown.jar (don't worry if there's a warning, .jar files are often considered as executable files, which they are)
  • To finish the installation:[n 2]
    • Under Windows:
      • Open a command line (cmd[3] or PowerShell)
      • Go inside the created folder (command cd [Path], for example cd C:\Users\Toto\WPCleaner)
      • Run the command java -version to ensure that Java is properly installed and that its version is at least 1.8
      • Run the command java -jar [Path]\getdown.jar [Path] (for example, java -jar C:\Users\Toto\WPCleaner\getdown.jar C:\Users\Toto\WPCleaner
    • Under Linux:
      • Open a command line (Terminal, Shell)
      • Go inside the created folder (command cd [Path], for example cd /home/toto/WPCleaner)
      • Run the command java -version to ensure that Java is properly installed and that its version is at least 1.8
      • Run the command java -jar [Path]/getdown.jar [Path] (for example, java -jar /home/toto/WPCleaner/getdown.jar /home/toto/WPCleaner)
    • Under MacOS:
      • Install JDK 10
      • Open a command line (Applications → Utilities → Terminal)[4]
      • Go inside the created folder (command cd [Path], for example cd ~/Applications/WPCleaner)
      • Run the command java -version to ensure that Java is properly installed and that its version is at least 1.8
      • Run the command java -jar [Path]/getdown.jar [Path] (for example, java -jar /home/toto/WPCleaner/getdown.jar /home/toto/WPCleaner)
    • Under another operating system, it's probably very similar to the installation under Linux
  • Getdown will then retrieve all the necessary files for using WPCleaner, and start WPCleaner


You can customize WPCleaner installation to simplify its daily usage:

  • Create shortcuts to start WPCleaner[n 3]
  • Create a file containing your connection credentials (credentials.txt : replace credentials between square brackets by the correct values):
General syntax Example
user=[Username]
password=[Password]
user=NicoV
password=MyPassword
  • Create personalized scripts
  • Create a file extra.txt in which each line is an option added to the JVM used by WPCleaner (for example, to increase the maximum size of the memory used to 8 GB, create this file with the line -Xmx8192M)
  • Note: files downloaded by getdown should not be modified, because any modification will be replaced at the next execution of WPCleaner.

Usage

[edit]

To start the graphical interface of WPCleaner, you can use the following methods (It is advised to create a shortcut[n 3] or optionally for the Mac, an Automator script):

  • Under Windows:
    • Double click on WPCleaner.bat
    • Run the command WPCleaner.bat -credentials credentials.txt en so that WPCleaner connects automatically to the English Wikipedia (the file credentials.txt needs to be created beforehand)
    • Run the command WPCleaner.bat en [Username] [Password] so that WPCleaner connects automatically to the English Wikipedia
  • Under Linux :
    • Double click on WPCleaner.sh[n 4]
    • Run the command WPCleaner.sh -credentials credentials.txt en[n 4] so that WPCleaner connects automatically to the English Wikipedia (the file credentials.txt needs to be created beforehand)
    • Run the command WPCleaner.sh en [Username] [Password][n 4] so that WPCleaner connects automatically to the English Wikipedia
  • Under Mac OS :
    • Locate and open /Applications/Automator.app in the Finder window.
    • Click type "Application" and double-click "Run shell script" from the middle list.
    • Replace the default "cat" text on the right side with java -jar <installation folder>/getdown.jar <installation folder> (for example, if you installed the script in /Applications/WPCleaner2, your Automator command would be java -jar /Applications/WPCleaner2/getdown.jar /Applications/WPCleaner2)
    • Save the Automator script into your Applications folder. Call it "WPCleaner2.app" or another name that makes sense to you.
    • To change the icon for this new application:
      • Right-click on the new app and choose Get Info.
      • In the WPCleaner2 installation folder, double-click on WPCleaner.png to open it.
      • In the Preview window that opens, double-click on the image and then Copy it to the clipboard (Edit > Copy).
      • In the Get Info window for your new WPCleaner2 app, click once on the small icon at the far upper left, then choose Edit > Paste. Close the Get Info window.
    • You should be able to double-click your new WPCleaner2.app to start WPCleaner 2.
  • Under any operating system (Windows, Linux or other) :
    • Run the command java -jar getdown.jar . from the installation folder (Note the "." at the end of the command which is mandatory)
    • Run the command java -jar getdown.jar . client -credentials credentials.txt en from the installation folder so that WPCleaner connects automatically to the English Wikipedia (the file credentials.txt needs to be created before hand)
    • Run the command java -jar getdown.jar . client en [Username] [Password] from the installation folder so that WPCleaner connects automatically to the English Wikipedia

To run WPCleaner in bot mode without any graphical interface (handling specific tasks), check the file Bot.bat or Bot.sh for explanations about the parameters to be used.

Troubleshooting

[edit]

This section tries to give answers for a few possible problems arising during the installation.

Java version

[edit]

Even if you've installed Java 8 or more recent on your computer, the one that is used in the command line may be an older one. You can see this problem at several steps in the installation process:

  • When you run the command java -version, the reported version can be below 1.8
  • When you run the installation command with getdown, you get an UnsupportedClassVersionError exception saying "Unsupported major.minor version 51.0" (version 51.0 is for Java 7, 52 for Java 8)

In each case, it means that the command line is using an older version of Java. You can either uninstall the older Java or make sure that the command line uses the newer Java.

For Mac installation, it seems to be a known problem (see this thread), but installing JDK 10 is likely to solve the problem.

Security

[edit]

WPCleaner needs your Wikipedia login and password to read and edit articles on which you want to work. To test WPCleaner, without the ability to save your modifications, you can use the Demo mode[n 5] without providing a password.

If you have activated two-factor authentication on your Wikipedia account, you need to create a bot password for WPCleaner, cf. this guide.[n 6]

Network configuration

[edit]

If you have a special network configuration (proxy, ...), some further configuration might be required.

User box

[edit]

If you want to show on your user page that you're using WPCleaner, you can use {{Wikipedia:WPCleaner/Userbox}} which will add the following user box

This user is a dedicated user of WPCleaner.

Using same preferences on another computer

[edit]

On Windows, WPCleaner stores most of its information in the Windows registry. If you change your computer and want to keep your configuration, you just need to copy the WPCleaner part of the registry from the old computer to the new one.

To copy your Windows configuration from one PC to a new PC, you can use Regedit:

  1. On the old PC, click Start > Run...
  2. Type regedit and click OK
  3. Select the folder HKEY_CURRENT_USER\Software\JavaSoft\Prefs\org\wikipediacleaner
  4. Click File > Export...
  5. Enter a file name and click Save
  6. Copy the .reg file from the old PC to the new PC
  7. On the new PC, right click on the .reg file and choose Merge
  8. When asked "Are you sure you want to add the information", click Yes
  9. Once the merge is complete, click OK

For Mac and Linux, there's a preference file for WPCleaner that can be copied over to another computer that uses Linux or Mac.

Notes and references

[edit]

Notes

[edit]
  1. ^ Releases older than 2.0 must be uninstalled because they are not updated anymore.
  2. ^ Dependending on your computer configuration, you may have to configure your firewall to allow javaw.exe access to the Internet so that WPCleaner can be downloaded and run.
  3. ^ a b Icons are provided in the installation folder, WPCleaner.ico for Windows and WPCleaner.png for Linux, Mac and other systems.
  4. ^ a b c For this to work, the script must have execution rights, which is not automatically possible with getdown for the moment. After the first installation (and eventually after each update which concerns this file), you have to give execution rights to this file with the command chmod a+x WPCleaner.sh).
  5. ^ For using the Demo mode, just provide your username, and click on the Demo button instead of the Login button: you will have access to all the features, without the ability to save your modifications as you're not logged in.
  6. ^ FAQ : Using WPCleaner with 2-factor authentication.

References

[edit]
  1. ^ If you get error messages like Unable to install Java. There are errors in the following switches..., it's that the association of .jar files with Java is broken: the jarfix tool may help, or you can run the installer with the following command java -jar [PATH_TO_INSTALLER]/WPCleanerInstaller.jar
  2. ^ If you get error messages like sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, it's probably that your Java version is too old and doesn't include the new root certificates for tools.wmflabs.org. Try upgrading your Java version.
  3. ^ 10 ways to launch the Command Prompt in Windows
  4. ^ Introduction to the Mac OS X Command Line