An open API service indexing awesome lists of open source software.

https://github.com/kernferm/libre-office

This PowerShell script automates the process of downloading and installing LibreOffice on Windows machines. It ensures that the script is run with administrator privileges, downloads the LibreOffice installer from the official mirror, and installs it to the specified directory.
https://github.com/kernferm/libre-office

installer-script libra libreoffice office powershell windows

Last synced: 4 months ago
JSON representation

This PowerShell script automates the process of downloading and installing LibreOffice on Windows machines. It ensures that the script is run with administrator privileges, downloads the LibreOffice installer from the official mirror, and installs it to the specified directory.

Awesome Lists containing this project

README

          

## Support the Project โญ

If you find this project useful, please give it a star! Your support is appreciated and helps keep the project growing. ๐ŸŒŸ

# ๐Ÿ–ฅ๏ธ LibreOffice Auto-Installer Script

This **PowerShell script** automates the process of downloading and installing **LibreOffice** on Windows machines. It ensures that the script is run with administrator privileges, downloads the LibreOffice installer from the official mirror, and installs it to the specified directory.

---

## ๐Ÿ“ฅ How to Download the Repo (First-Time Users)

Click the link to read [**Instructions**](https://www.gitprojects.fnbubbles420.org/how-to-download-repos) ๐Ÿ“„.

---

## โš™๏ธ Prerequisites

- **PowerShell 5.1 or higher**
- **Windows 7 or higher**
- **Internet connection** required to download the installer ๐ŸŒ
- You need to have PowerShell installed on your system to run the script.

### ๐Ÿ”ง v7.4.6 Release of PowerShell - Latest (recommended)

Select the version that matches your system specs:

- For **Windows 64-bit systems**: [Download 64-Bit Installer](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x64.msi)
- For **Windows 32-bit systems**: [Download 32-Bit Installer](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x86.msi)

---

## ๐Ÿ› ๏ธ PowerShell Script for LibreOffice Installation with Logging

This **PowerShell script** downloads and installs LibreOffice, with robust **error handling** and **logging** functionalities.

### ๐Ÿ“ Logging Functionality

The script includes a **logging function** that logs messages to both the console and a log file, which helps in tracking progress and errors during execution.

### Log File Location

All log messages are appended to a log file named `install_log.txt` located in the same directory as the script.

---

## ๐Ÿ”ง Logging Examples

Here are some example log entries:

- **Information Logs**:

```
2024-07-18 12:00:00 [INFO] Starting LibreOffice installation process.
2024-07-18 12:01:00 [INFO] Downloading LibreOffice installer...
2024-07-18 12:02:00 [INFO] Download completed successfully.
2024-07-18 12:03:00 [INFO] Installing LibreOffice...
```
- **Error Logs**:
```
2024-07-18 12:01:00 [ERROR] Failed to download the LibreOffice installer.
2024-07-18 12:04:00 [ERROR] Failed to install LibreOffice.
```

---

## ๐Ÿš€ How to Use

1. **Run PowerShell as Administrator**: Right-click on PowerShell and select **"Run as administrator"** ๐Ÿ”’.
2. **Navigate to Script Directory**: Use `cd` to navigate to the directory containing the script.
3. **Run the Script**:
```
.\LibreOffice-Auto-Installer.ps1
```
- If the script doesn't run, change the execution policy:
```
Set-ExecutionPolicy Bypass -Scope Process
```
- if a message pops up `red` type `Y` then click enter.

- Then run the script again without closing PowerShell.
```
.\LibreOffice-Auto-Installer.ps1
```

### ๐Ÿ› ๏ธ Features

- **Administrator Check**: Ensures the script is run with administrator privileges ๐Ÿ”’.
- **Automatic Download**: Downloads the latest version of **LibreOffice** from the official mirror ๐ŸŒ.
- **Silent Installation**: Installs LibreOffice silently without user interaction ๐Ÿ› ๏ธ.
- **Custom Installation Path**: Allows specifying a custom installation path for LibreOffice.
- **Clean Up**: Deletes the installer file after the installation is complete ๐Ÿงน.

---

### ๐Ÿ“ Customization

You can customize the installation by modifying the following variables in the script:

- `$LibreOfficeURL`: URL to the LibreOffice installer. Update this to change the version being installed.
- `$installPathLibreOffice`: Path where LibreOffice will be installed. Modify this to change the installation directory.

---

### ๐Ÿ“œ License

This script is released under the **MIT License**. See the [LICENSE](https://github.com/KernFerm/libre-office/blob/main/LICENSE) for more details ๐Ÿ“„.