2009-Nissan-Cube / About-This-Hack

Discover your hardware on macOS with this simple, user-friendly hardware info app that retains the beloved design language of the classic 'About This Mac' interface, while gaining access to a wealth of additional features.
MIT License
290 stars 23 forks source link

ATH v1.1.1 Update #91

Closed matxpa closed 6 months ago

matxpa commented 6 months ago

@0xCUB3 @MDNich

Hi

Since v1.1.1 About.This.Hack.zip contains a "dmg" not an "app" as with v1.1.0

About.This.Hack.zip v1.1.1

Capture d’écran 2024-05-04 à 17 20 23

And in "About This Hack.app" v1.1.1 "info.plist" "CFBundleShortVersionString" = 1.1.0

Capture d’écran 2024-05-04 à 18 43 14

About.This.Hack.zip v1.1.0

Capture d’écran 2024-05-04 à 17 19 12

Diff between UpdateController.swift v1.1.1 and v1.1.0 (no changes)

Capture d’écran 2024-05-04 à 17 31 23

UpdateController.swift can't work fine, UpdateController needs an "app" not a "dmg" to update ATH in /Applications so UpdateController.swift needs changes like

1) run("/usr/bin/hdiutil attach (tempDirectory)/(thisApplicationName)v(latestVersion).dmg" -nobrowse -quiet") 2) run("/bin/cp -rf "/Volumes/(thisApplicationName)/(thisApplicationName).app \"(initGlobVar.thisAppliLocation)\/(thisApplicationName).app\"") 3) run("/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep \"(thisApplicationName)\" | awk '{print $1}') -quiet")

\1) mount "dmg", 2) copy ATH.app to /Applications and 3) umount "dmg" when update is a "dmg" (ie. version > 110) and 2) could copy ATH.app from mounted "dmg" to (initGlobVar.tempDirectory) so it'll be like a previous version with the "app" extracted from à "zip".

Regards

and about previous issue N° 90 closed (Version.txt) : latest version Number could be obtained by latestVersion = run("GIT_TERMINAL_PROMPT=0 git ls-remote --tags --refs --sort=\"refname\" (initGlobVar.athrepositoryURL) | awk -F'/' '{print $NF}' | grep \"^[0-9]\" | tail -n1 | tr -d '\n'")

where "athrepositoryURL" is "https://github.com/0xCUB3/About-This-Hack"

so you didn't need a Version file containing the version number.

0xCUB3 commented 6 months ago

you're right. someone was very kind as to send me a DMG, but I forgot about the restrictions. I will switch back to a .app.

matxpa commented 6 months ago

@0xCUB3 Hi I could (I can) provide a modified UpdateController.swift component (with dependent others, InitGlobalVariables.swift and a new one called SystemFunctions.swift). Modified UpdateController.swift 1) manage a ".dmg" from version >= 111 and a ".app" otherwise. 2) check Minimum OS version allowed --> v1.1.1 cant' be installed (copied) on High Sierra 3) Notifications (Apple Dev. components) between OS 10.13 and 10.14 are different, and it's managed and tested

Regards

0xCUB3 commented 6 months ago

I will be switching back to .apps, so there is no need.

matxpa commented 6 months ago

@0xCUB3 @MDNich

Hi, F.Y.I

On High Sierra V1.1.1 Update (with a ".dmg" ) and update Minimum version vs current version comp

Capture d’écran 2024-05-08 à 18 55 35

Capture d’écran 2024-05-08 à 18 54 06

And on Monterey with Notifications (with UNUserNotificationCenter new class since 10.14) (NSUserNotification coded in v1.1.1 UpdateController.swift is deprecated since 10.14)

Capture d’écran 2024-05-08 à 19 20 34

Capture d’écran 2024-05-08 à 19 21 27

works both with a ".dmg" or ".app" extracted from ".zip"

And you could (if you would) get it from main branch (your v1.1.1 fork) on my repo.

Regards