Skip to content

Commit

Permalink
Update stuffz (#2)
Browse files Browse the repository at this point in the history
* Update icons for compatibility
* Create .gitignore, build.bat and BUILDING.md
* Add AutoHotkey icon for BUILDING.md
* Change version info
* Change README.md

---------

Co-authored-by: Guillaume <4777345+ltguillaume@users.noreply.github.com>
  • Loading branch information
Alex313031 and ltguillaume committed Sep 4, 2023
1 parent 09f6818 commit 9abfa96
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 19 deletions.
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.
17 changes: 17 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<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.

Optionally, [Resource Hacker](http://www.angusj.com/resourcehacker/#download) can be installed to remove all unused icons from the built executable.

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 Resource Hacker), then run `build.bat` from within the repo. It assumes that AutoHotKey and Resource Hacker are installed to 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
11 changes: 7 additions & 4 deletions Thorium-WinUpdater.ahk
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
; 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-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 +41,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 +769,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;%ProgramFiles%\Resource Hacker;%ProgramFiles(x86)%\Resource Hacker

cd /d "%~dp0"

Ahk2Exe.exe /in Thorium-WinUpdater.ahk

echo Done.

0 comments on commit 9abfa96

Please sign in to comment.