mirror of
https://github.com/Installomator/Installomator.git
synced 2026-02-21 13:43:35 +00:00
line break in appNewVersion in multiple labels #458
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @macbofh on GitHub.
The appNewVersion in some labels contains a line break so the versioncompare will not work
The comparison in the installomator code:
if [[ $appversion == $appNewVersion ]]; then......will always initiate a download and an application quit, but it will not install when it compares the downloaded version with the installed version.This is my output when running Dropbox
user@MBP - User Desktop % sudo /usr/local/Installomator/Installomator.sh dropbox
2022-11-18 22:07:44 : REQ : dropbox : ################## Start Installomator v. 10.0, date 2022-11-18
2022-11-18 22:07:44 : INFO : dropbox : ################## Version: 10.0
2022-11-18 22:07:44 : INFO : dropbox : ################## Date: 2022-11-18
2022-11-18 22:07:44 : INFO : dropbox : ################## dropbox
2022-11-18 22:07:45 : INFO : dropbox : BLOCKING_PROCESS_ACTION=tell_user
2022-11-18 22:07:45 : INFO : dropbox : NOTIFY=success
2022-11-18 22:07:45 : INFO : dropbox : LOGGING=INFO
2022-11-18 22:07:45 : INFO : dropbox : LOGO=/System/Applications/App Store.app/Contents/Resources/AppIcon.icns
2022-11-18 22:07:45 : INFO : dropbox : Label type: dmg
2022-11-18 22:07:45 : INFO : dropbox : archiveName: Dropbox.dmg
2022-11-18 22:07:45 : INFO : dropbox : no blocking processes defined, using Dropbox as default
2022-11-18 22:07:45 : INFO : dropbox : App(s) found: /Applications/Dropbox.app
2022-11-18 22:07:45 : INFO : dropbox : found app at /Applications/Dropbox.app, version 161.4.4923, on versionKey CFBundleShortVersionString
2022-11-18 22:07:45 : INFO : dropbox : appversion: 161.4.4923
2022-11-18 22:07:45 : INFO : dropbox : Latest version of Dropbox is 161.4.4923
2022-11-18 22:07:45 : REQ : dropbox : Downloading https://www.dropbox.com/download?plat=mac&full=1 to Dropbox.dmg
2022-11-18 22:08:05 : INFO : dropbox : found blocking process Dropbox
2022-11-18 22:08:39 : INFO : dropbox : telling app Dropbox to quit
2022-11-18 22:08:40 : INFO : dropbox : waiting 30 seconds for processes to quit
2022-11-18 22:09:10 : REQ : dropbox : no more blocking processes, continue with update
2022-11-18 22:09:10 : REQ : dropbox : Installing Dropbox
2022-11-18 22:09:10 : INFO : dropbox : Mounting /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.m7UxGksg/Dropbox.dmg
2022-11-18 22:09:13 : INFO : dropbox : Mounted: /Volumes/Dropbox Offline Installer
2022-11-18 22:09:13 : INFO : dropbox : Verifying: /Volumes/Dropbox Offline Installer/Dropbox.app
2022-11-18 22:09:18 : INFO : dropbox : Team ID matching: G7HH3F8CAK (expected: G7HH3F8CAK )
2022-11-18 22:09:18 : INFO : dropbox : Downloaded version of Dropbox is 161.4.4923 on versionKey CFBundleShortVersionString, same as installed.
2022-11-18 22:09:18 : INFO : dropbox : Telling app Dropbox.app to open
2022-11-18 22:09:18 : INFO : dropbox : Reopened Dropbox.app as user
2022-11-18 22:09:18 : REQ : dropbox : ################## End Installomator, exit code 0
I managed to find the following labels that had a line break in the appNewVersion:
Acronis Cyber Protect Connect Agent
Acronis Cyber Protect Connect
CLion
CodeRunner
DataGrip
Dropbox
IntelliJ IDEA CE
IntelliJ IDEA
JetBrains Toolbox
Malwarebytes
PHPStorm
PyCharm CE
PyCharm
RubyMine
SnapGene Viewer
SteelSeries GG
One way to fix this is to add
| tr -d '\r\n'to the end of the appNewVersion of these labels, but this will not fix the line breaks in future labels.You can consider to remove the line break somewhere in the compare logic
if [[ $appversion == $appNewVersion ]]; then......@Theile commented on GitHub:
This has actually puzzled me for some time. A line break that is not shown in the logging, as it is completely ignored there, and yet it exists, because some servers add it to the end of the text lines.
You have a great suggestion and I would say we should let Installomator remove these characters in the comparison.
@acodega commented on GitHub:
Believe fixed in Installomator 10.6
@PicoMitchell commented on GitHub:
I believe it could make sense to add
appNewVersion=$(echo $appNewVersion | tr -d '[:cntrl:]')immediately after this line right before the debug logging and before theappNewVersionwould be used for installation:c950d1d9e9/fragments/main.sh (L16)@PicoMitchell commented on GitHub:
Piping to
tr -d '[:cntrl:]'is a great way to remove\nand\ras well as any other possible control char that could ever pop up to cause problems.