Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stuffz #2

Merged
merged 11 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Thorium-WinUpdater.exe
Thorium-WinUpdater.ini
Binary file added AHK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<img src="Thorium-WinUpdaterBlue.ico" width="64">
<img src="AHK.png" width="64">

# Building Thorium WinUpdater.exe

Building this project requires [AutoHotKey 1.1](https://www.autohotkey.com/). \
AutoHotKey is a free and open-source custom scripting language for Microsoft Windows, for creating simple applications, macros, or (as the name implies) custom, OS level keyboard shortcuts.

The [.ahk file](Thorium-WinUpdater.ahk) is the main script. \
The PS1 files are PowerShell scripts for adding/removing a scheduled task that runs the updater. \
The .ico files are used in the UI of the final .exe

`Ahk2Exe.exe` is used to bundle and convert these files into a single executable.

You can install AutoHotKey and then run `build.bat` from within the repo. It assumes that AutoHotKey is installed in the default location.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
<img src="Thorium-WinUpdater.ico" align="right">

# Thorium WinUpdater
by ltGuillaume: [Codeberg](https://codeberg.org/ltGuillaume) | [GitHub](https://github.com/ltGuillaume) | [Buy me a beer](https://buymeacoff.ee/ltGuillaume) 🍺
By ltGuillaume: [Codeberg](https://codeberg.org/ltGuillaume) | [GitHub](https://github.com/ltGuillaume) | [Buy me a beer](https://buymeacoff.ee/ltGuillaume) 🍺

An attempt to make updating [Thorium for Windows](https://github.com/Alex313031/Thorium-Win-AVX2) much easier. This is a fork of [LibreWolf WinUpdater](https://codeberg.org/ltGuillaume/librewolf-winupdater).

![Thorium WinUpdater](SCREENSHOT.png)

## Getting started
- If you want to run the portable version of Thorium, download and extract [`Thorium_AVX2_xxx.x.xxxx.x.zip`](https://github.com/Alex313031/Thorium-Win-AVX2/releases). Put `Thorium-WinUpdater.exe` in the same folder.
## Usage
- If you want to run the portable version of Thorium, download and extract [`Thorium_AVX2_xxx.x.xxxx.x.zip`](https://github.com/Alex313031/Thorium-Win-AVX2/releases). Put `Thorium-WinUpdater.exe` in the same folder.
Then, if you wish to perform an update, just run `Thorium-WinUpdater.exe`.
- When you have installed Thorium using the [Thorium_AVX2_mini_installer.exe](https://github.com/Alex313031/Thorium-Win-AVX2/releases), just run `Thorium-WinUpdater.exe` from any place you like to check for updates. If one is available, it will be downloaded immediately.
- When you have installed Thorium using the [Thorium_AVX2_mini_installer.exe](https://github.com/Alex313031/Thorium-Win-AVX2/releases), just run `Thorium-WinUpdater.exe` from any location to check for updates. If one is available, the new mini installer will be downloaded immediately.

## Scheduled updates
- Run Thorium WinUpdater and select the option to automatically check for updates. This will prompt for administrator permissions and a blue (PowerShell) window will notify you of the result. The scheduled task will run while the current user account is logged on (at start-up and every 24 hours).
- If your account has administrator permissions, the update will be fully automatic. If not, the update will be downloaded and you will be asked by WinUpdater to start the update.
- If Thorium is already running, the updater will notify you of the new version. The update will start as soon as you close the browser.
## Scheduled Updates
- Run Thorium WinUpdater and select the option to automatically check for updates. This will prompt for administrative permissions and a blue (PowerShell) window will open and notify you of the result. The scheduled task will run while the current user account is logged on (at start-up and every 24 hours).
- If your account has administrator privileges, the update will be fully automatic. If not, the update will be downloaded and you will be asked by WinUpdater to start the update.
- If Thorium is already running, the updater will notify you of the new version. The update will start as soon as you close the browser.

## Remarks
- The updater needs to be able to write to `Thorium-WinUpdater.ini` in its own folder, (so make sure it has permission to do so), otherwise WinUpdater will copy itself to `%LocalAppData%\Thorium\WinUpdater` and run from there.
- `Thorium-WinUpdater.ini` contains a `[Log]` section that shows the results of the last update check and update action.
- Thorium WinUpdater also updates itself automatically, so you won't have to check for new releases here. If you prefer to update WinUpdater yourself, add the following to the .ini file:
- The updater needs to be able to write to `Thorium-WinUpdater.ini` in its own folder (so make sure it has permission to do so), otherwise WinUpdater will copy itself to `%LocalAppData%\Thorium\WinUpdater` and run from there.
- `Thorium-WinUpdater.ini` contains a `[Log]` section that shows the results of the last update check and update action.
- Thorium WinUpdater also updates itself automatically, so you won't have to check for new releases here. If you prefer to update WinUpdater yourself, add the following to the .ini file:
```ini
[Settings]
UpdateSelf=0
```
- Thorium by default downloads the AVX2 build. You can change the build to `Win` or `Win7` by adding the following to the .ini file:
- Thorium by default downloads the AVX2 build. You can change the build to `Win` or `Win7` by adding the following to the .ini file:
```ini
[Settings]
Build=Win7
```
_Obviously, don't add the line `[Settings]` twice_.
- __NOTE:__ The `Win` build is for systems lacking [AVX2 instructions](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2). The `Win7` builds are for Windows 7/8/8.1 systems, because of Chromium deprecating support for these OSes as per [Here](https://support.google.com/chrome/thread/185534985/).

## Building
- Requires [AutoHotKey 1.1](https://www.autohotkey.com/) \
See [BUILDING.md](https://github.com/Alex313031/thorium-winupdater/blob/main/BUILDING.md)

## Credits
* [Thorium](https://thorium.rocks) by [Alex Frick](https://github.com/Alex313031)
* The Chromium Project
* Original icon by the [Alex Frick](https://github.com/Alex313031/thorium/blob/main/logos/NEW/win/thorium.ico)
* Original logo by the [Alex Frick](https://github.com/Alex313031/thorium/blob/main/logos/STAGING/Thorium90_252.jpg)
* [The Chromium Project](https://www.chromium.org)
* [Original icon](https://github.com/Alex313031/thorium/blob/main/logos/NEW/win/thorium.ico) by Alex Frick
* [Original logo](https://github.com/Alex313031/thorium/blob/main/logos/STAGING/Thorium90_252.jpg) by Alex Frick
Binary file added ResourceHacker.exe
Binary file not shown.
12 changes: 8 additions & 4 deletions Thorium-WinUpdater.ahk
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
; Thorium WinUpdater - https://codeberg.org/ltguillaume/thorium-winupdater
;@Ahk2Exe-SetFileVersion 1.7.11
;@Ahk2Exe-SetFileVersion 1.7.12
;@Ahk2Exe-SetProductVersion 1.7.12

;@Ahk2Exe-Base Unicode 32*
;@Ahk2Exe-SetCompanyName The Chromium Authors and Alex313031
;@Ahk2Exe-SetDescription Thorium WinUpdater
;@Ahk2Exe-SetCopyright ltguillaume and Alex313031
;@Ahk2Exe-SetDescription Thorium Browser Windows Updater
;@Ahk2Exe-SetMainIcon Thorium-WinUpdater.ico
;@Ahk2Exe-AddResource Thorium-WinUpdaterLogo.ico, 160
;@Ahk2Exe-AddResource Thorium-WinUpdaterBlue.ico, 161
;@Ahk2Exe-SetOrigFilename Thorium-WinUpdater.exe
;@Ahk2Exe-SetProductName Thorium WinUpdater
;@Ahk2Exe-PostExec ResourceHacker.exe -open "%A_WorkFileName%" -save "%A_WorkFileName%" -action delete -mask ICONGROUP`,206`, ,,,,1
;@Ahk2Exe-PostExec ResourceHacker.exe -open "%A_WorkFileName%" -save "%A_WorkFileName%" -action delete -mask ICONGROUP`,207`, ,,,,1
;@Ahk2Exe-PostExec ResourceHacker.exe -open "%A_WorkFileName%" -save "%A_WorkFileName%" -action delete -mask ICONGROUP`,208`, ,,,,1
Expand Down Expand Up @@ -38,7 +42,7 @@ Global _Thorium := "Thorium"
, _IsElevated := "To set up scheduled tasks properly, please do not run WinUpdater as administrator."
, _NoDefaultBrowser := "Could not open your default browser."
, _Checking := "Checking for new version..."
, _SetTask := "Schedule a task for automatic update checks while`nuser {} is logged on."
, _SetTask := "Schedule a task for automatic update checks while`nuser '{}' is logged on."
, _SettingTask := (A_Args[1] = "/CreateTask" ? "Creating" : "Removing") " scheduled task..."
, _Done := " Done."
, _GetPathError := "Could not find the path to Thorium.`nBrowse to " ThoriumExe " in the following dialog."
Expand Down Expand Up @@ -766,4 +770,4 @@ Unelevate(Prms*) {
ExitApp
} Catch e
Die(_IsElevated)
}
}
Binary file modified Thorium-WinUpdater.ico
Binary file not shown.
Binary file modified Thorium-WinUpdaterBlue.ico
Binary file not shown.
Binary file modified Thorium-WinUpdaterLogo.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

title=Building Thorium WinUpdater

set PATH=%PATH%;%ProgramFiles%\AutoHotkey\Compiler

cd /d "%~dp0"

Ahk2Exe.exe /in Thorium-WinUpdater.ahk

echo Done.