diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml index 48138c0..e18e6d8 100644 --- a/.github/workflows/package-publish.yml +++ b/.github/workflows/package-publish.yml @@ -49,6 +49,7 @@ jobs: name: Homebrew Cask - Pull request runs-on: macos-latest steps: + - run: export HOMEBREW_GITHUB_API_TOKEN=${HOMEBREW_GITHUB_API_TOKEN} - uses: macauley/action-homebrew-bump-cask@v1 with: token: ${WINGET_TOKEN} diff --git a/Scripts/install-uvtools.sh b/Scripts/install-uvtools.sh index fdd3bca..904ccb7 100644 --- a/Scripts/install-uvtools.sh +++ b/Scripts/install-uvtools.sh @@ -8,6 +8,7 @@ #cd "$(dirname "$0")" arch="$(uname -m)" # x86_64 or arm64 +archCode="${arch/86_/}" osVariant="" # osx, linux, arch, rhel api_url="https://api.github.com/repos/sn4k3/UVtools/releases/latest" dependencies_url="https://raw.githubusercontent.com/sn4k3/UVtools/master/Scripts/install-dependencies.sh" @@ -88,7 +89,7 @@ done echo "Error: UVtools.app not found on known paths" ' > "$run_script" - chmod a+x "$run_script" + chmod 775 "$run_script" echo "Note: Always run \"bash run-uvtools\" from your Desktop to launch UVtools on this Mac (arm64)!" fi @@ -147,35 +148,30 @@ if [ -z "$download_url" ]; then fi filename="$(basename "${download_url}")" -tmpfile="/tmp/$filename" +tmpfile=$(mktemp "${TMPDIR:-/tmp}"/UVtoolsUpdate.XXXXXXXX) echo "Downloading: $download_url" -#wget $download_url -O "$tmpfile" -q --show-progress curl -L --retry 4 $download_url -o "$tmpfile" -echo "- Setting permissions" -chmod -fv a+x "$tmpfile" - echo "- Kill instances" killall -q UVtools -if [ -d "$HOME/Applications" ]; then - echo "- Removing old versions" - rm -f "$HOME/Applications/UVtools_*.AppImage" - - echo "- Moving $filename to $HOME/Applications" - mv -f "$tmpfile" "$HOME/Applications" - - "$HOME/Applications/$filename" & - echo "If prompt for \"Desktop integration\", click \"Integrate and run\"" -else - echo "- Removing old versions" - rm -f UVtools_*.AppImage +targetDir="$PWD" +[ -d "$HOME/Applications" ] && targetDir="$HOME/Applications" +targetFilePath="$targetDir/$filename" - echo "- Moving $filename to $(pwd)" - mv -f "$tmpfile" . +echo "- Removing old versions" +rm -f "$targetDir/UVtools_"*".AppImage" - ./$filename & -fi +echo "- Moving $filename to $targetDir" +mv -f "$tmpfile" "$targetFilePath" -echo "UVtools will now run." +echo "- Setting permissions" +chmod -fv 775 "$targetFilePath" + +"$targetFilePath" & + +echo '' +echo 'UVtools will now run.' +echo 'If prompt for "Desktop integration", click "Integrate and run"' +echo '' diff --git a/UVtools.WPF/Structures/AppVersionChecker.cs b/UVtools.WPF/Structures/AppVersionChecker.cs index d1ca6ec..0652759 100644 --- a/UVtools.WPF/Structures/AppVersionChecker.cs +++ b/UVtools.WPF/Structures/AppVersionChecker.cs @@ -223,7 +223,7 @@ public class AppVersionChecker : BindableBase if (File.Exists(appImagePath)) File.Delete(appImagePath); File.Move(DownloadedFile, newFullPath, true); - SystemAware.StartProcess("chmod", $"a+x \"{newFullPath}\"", true); + SystemAware.StartProcess("chmod", $"775 \"{newFullPath}\"", true); Thread.Sleep(500); SystemAware.StartProcess(newFullPath); } diff --git a/build/createRelease.sh b/build/createRelease.sh index e2dbb42..128ee59 100644 --- a/build/createRelease.sh +++ b/build/createRelease.sh @@ -113,9 +113,9 @@ rm -rf "$projectDir/bin/$buildWith/net$netVersion/$runtime" 2>/dev/null rm -rf "$projectDir/obj/$buildWith/net$netVersion/$runtime" 2>/dev/null echo "5. Setting Permissions" -chmod -fv a+x "$publishRuntimeDir/UVtools" -chmod -fv a+x "$publishRuntimeDir/UVtoolsCmd" -chmod -fv a+x "$publishRuntimeDir/UVtools.sh" +chmod -fv 775 "$publishRuntimeDir/UVtools" +chmod -fv 775 "$publishRuntimeDir/UVtoolsCmd" +chmod -fv 775 "$publishRuntimeDir/UVtools.sh" if [[ "$runtime" == win-* ]]; then echo "6. Windows should be published in a windows machine!" @@ -170,7 +170,7 @@ else tempDir="$(mktemp -d /tmp/uvtoolspublish.XXXXXX)" # Allow parallel publishes appImageFile="appimagetool-x86_64" wget -O "$tempDir/appimagetool-x86_64.AppImage" "https://github.com/AppImage/AppImageKit/releases/download/continuous/$appImageFile.AppImage" - chmod a+x "$tempDir/$appImageFile.AppImage" + chmod 775 "$tempDir/$appImageFile.AppImage" # Extract AppImage so it can be run in Docker containers and on machines that don't have FUSE installed # Note: Extracting requires libglib2.0-0 to be installed cd "$tempDir" @@ -179,7 +179,7 @@ else # Create the AppImage ARCH=x86_64 "$tempDir/squashfs-root/AppRun" "$linuxAppDir" "$linuxAppImage" - chmod a+x "$linuxAppImage" + chmod -fv 775 "$linuxAppImage" # Remove the base publish if able #[ "$keepNetPublish" == false ] && rm -rf "$publishRuntimeDir" 2>/dev/null