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.
- Host: GitHub
- URL: https://github.com/kernferm/libre-office
- Owner: KernFerm
- License: mit
- Created: 2024-06-15T09:22:09.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T20:23:05.000Z (over 1 year ago)
- Last Synced: 2025-07-21T22:46:09.998Z (10 months ago)
- Topics: installer-script, libra, libreoffice, office, powershell, windows
- Language: PowerShell
- Homepage:
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.MD
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 ๐.