mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
App from App Store
In this branch I demand that INSTALL=force if an App Store app should be replaced. Best example is Slack that will loose all settings if it is replaced. But we can still do it and the log will show what we are doing.
This commit is contained in:
@@ -173,6 +173,17 @@ getAppVersion() {
|
||||
#appversion=$(mdls -name kMDItemVersion -raw $installedAppPath )
|
||||
appversion=$(defaults read $installedAppPath/Contents/Info.plist $versionKey) #Not dependant on Spotlight indexing
|
||||
printlog "found app at $installedAppPath, version $appversion"
|
||||
# Is current app from App Store
|
||||
if [[ -d "$installedAppPath"/Contents/_MASReceipt ]];then
|
||||
printlog "Installed $appName is from App Store, use INSTALL=force to replace."
|
||||
# INSTALL="force"
|
||||
# Maybe we should exit instead
|
||||
if [[ $INSTALL == "force" ]]; then
|
||||
printlog "Force is used so continuing"
|
||||
else
|
||||
cleanupAndExit 1 "App previously installed from App Store"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
printlog "could not determine location of $appName"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user