line break in appNewVersion in multiple labels #458

Closed
opened 2026-01-19 18:34:07 +00:00 by michael · 4 comments
Owner

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......

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......`
michael added the bug label 2026-01-19 18:34:07 +00:00
Author
Owner

@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.

@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.
Author
Owner

@acodega commented on GitHub:

Believe fixed in Installomator 10.6

@acodega commented on GitHub: Believe fixed in Installomator 10.6
Author
Owner

@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 the appNewVersion would be used for installation: c950d1d9e9/fragments/main.sh (L16)

@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 the `appNewVersion` would be used for installation: https://github.com/Installomator/Installomator/blob/c950d1d9e94cd1af7b6a23e901144213c04774c4/fragments/main.sh#L16
Author
Owner

@PicoMitchell commented on GitHub:

Piping to tr -d '[:cntrl:]' is a great way to remove \n and \r as well as any other possible control char that could ever pop up to cause problems.

@PicoMitchell commented on GitHub: Piping to `tr -d '[:cntrl:]'` is a great way to remove `\n` and `\r` as well as any other possible control char that could ever pop up to cause problems.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Installomator/Installomator#458