# ComptaPro — Client guide: installation, getting started and backups

From the installer received from the publisher to the weekly backups, through
the first launch, the 30-day trial and key activation.

> **Audience**: you, the client (owner or accountant who installs and runs
> ComptaPro).
> **Companions** (French only): `installateur/Lisez-moi.txt` (memo handed over
> at installation) and `installateur/deploiement/README-deploiement.md`
> (silent multi-workstation install, for your IT person).
> The commands in §5 (backup, verification, restore) have been run and
> verified; the interface steps described in §1 to §4 match the installer and
> the software screens.
>
> **Languages**: the installer itself is French only — its pages, the
> « Lancer ComptaPro maintenant » option and the « Pointage employés »
> shortcut keep their French labels. The **application** interface can be
> switched to English or Spanish: menu « Langue » (bottom of the sidebar), or
> Settings → User accounts → Language. Screen names below are given in the
> language you are reading, followed by the French label where it differs.
>
> **Other versions**: [français](GUIDE-CLIENT.md) · [español](GUIDE-CLIENT.es.md)

---

## 1. Installation

### 1.1 What you need before starting

| Need | Detail |
|---|---|
| System | Windows 10 or later, 64-bit |
| Rights | No administrator required: installation is **per user** |
| Network | No Internet connection needed to use the software |
| File | `ComptaPro-Setup-<version>.exe` received from the publisher (if a SHA-256 fingerprint is published next to the link, check it before running) |

### 1.2 Running the installer

1. Double-click `ComptaPro-Setup-<version>.exe`.
2. Keep the proposed installation folder:
   `%LOCALAPPDATA%\Programs\ComptaPro` — the software and your data stay side
   by side, writable, with no administrator rights.
3. The proposed checkboxes:

| Option | Default | Effect |
|---|---|---|
| Create a Desktop shortcut | checked | « ComptaPro » shortcut to launch the software |
| Start ComptaPro automatically with Windows | unchecked | the server starts at login, in a background window |
| Create the rescue task that imports statements dropped off while the software is closed (every 15 minutes) | unchecked (optional) | tick it if you drop off bank statements while ComptaPro is closed: the task relaunches it in the background to import them |

4. At the end, leave « Lancer ComptaPro maintenant » ("Launch ComptaPro now")
   ticked.

### 1.3 Where your data lives

Everything is local, in the installation folder:

| Folder | Contents |
|---|---|
| `compta\data\` | database, invoice photos, sessions |
| `compta\sauvegardes\` | backup archives (see §5) |
| `compta\planifier\` | scheduled-task scripts (backup, statement rescue) |

No data is sent to the Internet (see also §4: activation is itself verified
locally).

### 1.4 Updating

Just run the new `ComptaPro-Setup-<version>.exe`: the server is stopped
automatically, files are replaced, your data is kept. Existing scheduled tasks
(backup, statement rescue) are kept — the installation folder does not change,
so their paths remain valid. The rescue task script is only regenerated if the
« secours » option is ticked again (or passed via `/TASKS=secours`) at the time
of the update.

### 1.5 Uninstalling

Control Panel → Programs and Features → ComptaPro → Uninstall. Windows will
ask whether you also want to delete your accounting data (irreversible) or
keep it. By default, data and backup archives are kept.

---

## 2. First launch

### 2.1 The black window is the software

- Double-click the « ComptaPro » shortcut (Desktop or Start menu).
- **Leave the black window open**: it is the software's server.
  **DO NOT CLOSE THIS WINDOW**, otherwise the software stops — the most common
  cause of “ComptaPro is not responding”. If it crashes, relaunch the
  shortcut: that's all.
- The window shows three addresses:
  - `http://localhost:8090/` — the software on **this** workstation (the
    browser opens automatically);
  - `http://localhost:8090/punch` — the time-clock page;
  - the **local network** address: that is the one, not localhost, that
    employees' phones use to clock in.

### 2.2 First sign-in

| Field | Initial value |
|---|---|
| Username | `admin` |
| Password | `admin1234` |

→ **Change the password immediately**: Settings (« Paramètres ») → User
accounts (« Comptes administrateurs »).

### 2.3 Demo data

On the very first opening the software loads a set of demo data (invoices,
expenses, employees, timesheets) so that every screen is meaningful. You then
work on your own data; if you are unsure about the origin of a document, check
its date.

### 2.4 Employee time clock

- Dedicated page: `http://<workstation-address>:8090/punch` (opens with the
  « Pointage employés » shortcut in the Start menu — French label).
- Phones clock in via the network address shown in the black window — never
  via `localhost`, which designates each phone itself.

---

## 3. 30-day trial

- **The countdown starts at the first opening** of the software: no
  paperwork, no credit card, **all features** for 30 full days, on your real
  data.
- Duration is measured from the first opening: setting the machine clock back
  does not extend the trial.
- Reminders: a banner appears during the **last 10 days** of the trial (it
  turns red below **3 days**) and goes straight to the License screen.
- After 30 days, without a key, the software is locked: only sign-in, the
  License screen and the time clock remain accessible. Your data stays on the
  machine.
- **There is no “extend the trial” command**: for more time, ask the publisher
  for a key via the site's form (a time-limited key acts as an extended trial
  — see §4).

---

## 4. Activation and renewal

1. Menu → **License and activation** (« Licence et activation »).
2. Enter the key provided by the publisher — it starts with **`CMPR2.`** —
   then submit.
3. The screen shows your license status: type and, for a time-limited key, its
   **expiry date**.

Key facts:

- **Verification is 100% local**: the key is a digital signature (Ed25519)
  checked on your machine; nothing is sent over the Internet, neither key nor
  data (stated on the sales page and the License screen).
- **Two key types**:

  | Type | Validity |
  |---|---|
  | Perpetual | no time limit |
  | Time-limited | 1 year; once the date shown on the License screen passes, the software is locked |
- **Renewal**: the publisher gives you a renewal key to enter in the same
  place (License screen).
- **The key is a bearer instrument**: whoever holds it can activate it. Keep
  it off the computer (paper copy or email) — you will need it if you
  reinstall; do not share it.

---

## 5. Backups and restore

### 5.1 What an archive contains

Each backup groups **the database, the invoice photos and the sessions**, in a
dated file:

```
sauvegarde-AAAA-MM-JJ_HH-MM-SS.zip.chiffre    (encrypted — default)
sauvegarde-AAAA-MM-JJ_HH-MM-SS.zip            (unencrypted, with --sans-chiffrement)
```

- Default folder: `compta\sauvegardes\`.
- **The password is essential**: without it, an encrypted archive is
  permanently unusable. It is passed to the scheduling script via
  `--mot-de-passe` and stored in `compta\planifier\mot-de-passe-sauvegarde.txt`
  — **keep a copy somewhere else** than this workstation.
- Archives only protect you if they leave the machine: copy
  `compta\sauvegardes\` regularly to an external drive or a network share.

Open a command window **in the installation folder**
(`%LOCALAPPDATA%\Programs\ComptaPro`). If `node` is not on your PATH, use the
Node shipped with the software (`.runtime\node\node.exe`), as below.

### 5.2 Manual backup

```
.runtime\node\node.exe compta\scripts\sauvegarde.js
```

- Can run **while the software is running** (`VACUUM INTO` snapshot, nothing
  to stop).
- Keeps the **last 5** archives by default: `--conserver N` to change,
  `--tout-conserver` to delete nothing.
- The password is taken (in this order) from `--mot-de-passe`, from the
  `SAUVEGARDE_MOT_DE_PASSE` environment variable, then from the file
  `compta\planifier\mot-de-passe-sauvegarde.txt`.

### 5.3 Scheduled weekly backup

```
.runtime\node\node.exe compta\scripts\planifier-sauvegarde.js -aide
```

Then install it (defaults: **every Monday at 02:00**, 5 archives kept):

```
.runtime\node\node.exe compta\scripts\planifier-sauvegarde.js --mot-de-passe <your-password>
```

- The task appears in the Windows Task Scheduler as
  « ComptaPro - Sauvegarde hebdomadaire »; the generated script is in
  `compta\planifier\`, the log in `compta\sauvegardes\`.
- Like any user task, it only runs if the computer is on and the user is
  logged in at the scheduled time.
- `--jour` / `--heure` / `--conserver` adjust the schedule; `--afficher` shows
  the status; `--desinstaller` removes it.

### 5.4 Verify archive integrity

```
.runtime\node\node.exe compta\scripts\sauvegarde.js -verifier
```

CRC32 check of every entry, SHA-256 of the database, SQLite integrity,
counts, photos and sessions — **creating and deleting nothing**. Exit code 1
if an archive is corrupted. Detail for a single archive:

```
.runtime\node\node.exe compta\scripts\restauration.js <archive> --verifier-seulement
```

### 5.5 Restoring

1. **Stop ComptaPro** (close the black window): the restore refuses to run
   while the server is listening.
2. Check the archive if needed (above), then apply it:

```
.runtime\node\node.exe compta\scripts\restauration.js "<archive>" --mot-de-passe <your-password>
```

3. **Restart ComptaPro**: your data is back exactly as it was in the archive
   (restore replaces the data folder, it does not “merge” anything).

If you are unsure about an archive, `--verifier-seulement` changes nothing:
it is the check mode to run before committing.
