Skip to content

Commit

Permalink
Merge pull request #1900 from mrpalide/fix/mac-installer-issues
Browse files Browse the repository at this point in the history
Fix Mac Installer
  • Loading branch information
mrpalide authored Nov 2, 2024
2 parents ebff58d + e3eadcd commit c788c79
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 23 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

updates may be generated with `scripts/changelog.sh <PR#lowest> <PR#highest>`

## 1.3.29

- Fix Mac installer issue [#1900](https://github.com/skycoin/skywire/pull/1900)
- Fix WIX issue on versioning of Windows installer [#1899](https://github.com/skycoin/skywire/pull/1899)
- Fix issue on release workflow [#1896](https://github.com/skycoin/skywire/pull/1896)
- Improve Mac survey [#1895](https://github.com/skycoin/skywire/pull/1895)
- Improve Windows installer [#1894](https://github.com/skycoin/skywire/pull/1894)
- Reward on Windows [#1892](https://github.com/skycoin/skywire/pull/1892)
- Embed scripts for reward system [#1888](https://github.com/skycoin/skywire/pull/1888)
- Fix codebase issues [#1885](https://github.com/skycoin/skywire/pull/1885)
- Update Reward Calculation Cli &amp; UI [#1884](https://github.com/skycoin/skywire/pull/1884)
- Update dependencies [#1880](https://github.com/skycoin/skywire/pull/1880)
- Fix dmsghttp config gen logic [#1877](https://github.com/skycoin/skywire/pull/1877)
- Fix services-config.json path reference for `skywire cli config gen` [#1875](https://github.com/skycoin/skywire/pull/1875)

## 1.3.26

- Embed Deployment Configuration [#1873](https://github.com/skycoin/skywire/pull/1873)
Expand Down
33 changes: 19 additions & 14 deletions scripts/mac_installer/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
## Mac Installer

### Sort of Questions
- Q: *What is the equivalent of the systemd service used for controlling the running process?*

- Q: *What is the equivalent of the systemd service used for controlling the running process?*
A: No systemd service there. User just should run app from menu or desktop shortcut.
- Q: *How do you manually start and stop skywire via this framework?*


- Q: *How do you manually start and stop skywire via this framework?*
A: Running by shortcut on desktop or menu.
- Q: *How do you enable or disable skywire starting at boot?*


- Q: *How do you enable or disable skywire starting at boot?*
A: Not available by UI or other things. Should add it manually by user to startup items.
- Q: *What is the default config file path?*


- Q: *What is the default **config file** path?*
A: `/Users/{user}/Library/Application Support/Skywire/skywire-config.json`
- Q: *What is included in the packaging besides skywire? (i.e. scripts, services, batch files, etc.)*


- Q: *What is the default **local** and **dmsghttp-server** path?*
A: `/Library/Applicaton Support/Skywire`

- Q: *What is the default **logs** path?*
A: `/Users/{user}/Library/Logs/Skywire/visor.log`

- Q: *What is included in the packaging besides skywire? (i.e. scripts, services, batch files, etc.)*
A: - a bash script called **Skywire** that include a command to run skywire-visor on config. (Line 82 of create_installer.sh)
- Q: *Where are the sources for the build of the installer or package?*


- Q: *Where are the sources for the build of the installer or package?*
A: `scripts\mac_installer`
- Q: *What are the dependencies required to build either of these? mac package*


- Q: *What are the dependencies required to build either of these? mac package*
A: nothing
4 changes: 2 additions & 2 deletions scripts/mac_installer/create_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function build_installer() {

# Create directories
mkdir -p ${installer_build_dir}/binaries/Skywire.app
mkdir -p ${installer_package_dir}/Contents/{Resources,MacOS/apps}
mkdir -p ${installer_package_dir}/Contents/{Resources,MacOS}

# build deinstaller
go build -o ${installer_package_dir}/Contents/MacOS/deinstaller ${mac_script_dir}/desktop-deinstaller/deinstaller.go
Expand All @@ -78,7 +78,7 @@ function build_installer() {
cat <<EOF >${installer_package_dir}/Contents/MacOS/SkywireLauncher
#!/bin/bash
osascript -e "do shell script \"/Applications/Skywire.app/Contents/MacOS/skywire visor -c '/Users/\${USER}/Library/Application Support/Skywire/skywire-config.json' --systray > /Users/\${USER}/Library/Logs/skywire/visor.log\" with administrator privileges"
osascript -e "do shell script \"/Applications/Skywire.app/Contents/MacOS/skywire visor -c '/Users/\${USER}/Library/Application Support/Skywire/skywire-config.json' --systray > /Users/\${USER}/Library/Logs/Skywire/visor.log\" with administrator privileges"
EOF

Expand Down
2 changes: 1 addition & 1 deletion scripts/mac_installer/desktop-deinstaller/deinstaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pkgutil --forget ` + osxServiceIdentifier + `
pkgutil --forget com.skycoin.skywire.updater
pkgutil --forget com.skycoin.skywire.remover
rm -rf ` + filepath.Join(os.Getenv("HOME"), "Library", "Logs", "skywire") + `
rm -rf ` + filepath.Join(os.Getenv("HOME"), "Library", "Logs", "Skywire") + `
rm -rf /Applications/Skywire.app
`

Expand Down
4 changes: 2 additions & 2 deletions scripts/mac_installer/install_scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

skywire_dir=/Users/${USER}/Library/Application\ Support/Skywire
log_dir=/Users/${USER}/Library/Logs/skywire
log_dir=/Users/${USER}/Library/Logs/Skywire

if [[ -d ${skywire_dir} ]]; then
rm -rf "${skywire_dir}"
Expand All @@ -15,7 +15,7 @@ chown -R "${USER}" "$skywire_dir"

echo "generating skywire config if it doesn't exist"
if [[ ! -f "${skywire_dir}"/skywire-config.json ]]; then
/Applications/Skywire.app/Contents/MacOS/skywire cli config gen -bpio "${skywire_dir}"/skywire-config.json
/Applications/Skywire.app/Contents/MacOS/skywire cli config gen --loglvl info -bpio "${skywire_dir}"/skywire-config.json
fi
chown "${USER}" "${skywire_dir}"/skywire-config.json

Expand Down
2 changes: 1 addition & 1 deletion scripts/mac_installer/install_scripts/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

log_dir=/Users/${USER}/Library/Logs/skywire
log_dir=/Users/${USER}/Library/Logs/Skywire

mkdir -p /Users/"${USER}"/Library/Application\ Support/Skywire

Expand Down
2 changes: 1 addition & 1 deletion scripts/mac_installer/remove_scripts/postinstall
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

skywire_dir=/Users/${USER}/Library/Application\ Support/Skywire
log_dir=/Users/${USER}/Library/Logs/skywire
log_dir=/Users/${USER}/Library/Logs/Skywire

sudo -u "$USER" launchctl remove com.skycoin.skywire.logcleaner

Expand Down
2 changes: 1 addition & 1 deletion scripts/mac_installer/update_scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ if [[ -L /usr/local/bin/skywire-cli ]]; then
unlink /usr/local/bin/skywire-cli
fi

/Applications/Skywire.app/Contents/MacOS/skywire cli config gen -bprio "${skywire_dir}"/skywire-config.json
/Applications/Skywire.app/Contents/MacOS/skywire cli config gen --loglvl info -bprio "${skywire_dir}"/skywire-config.json
chown "${USER}" "${skywire_dir}"/skywire-config.json

2 changes: 1 addition & 1 deletion scripts/win_installer/skywire.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if exist "%HOMEPATH%\skywire-config.json" (

:: Generating new config file if not exist
if not exist "skywire-config.json" (
skywire cli config gen -birpw --disableapps vpn-server -S services-config.json -D dmsghttp-config.json >nul 2>&1
skywire cli config gen -birpw --disableapps vpn-server -S services-config.json -D dmsghttp-config.json --loglvl info >nul 2>&1
)

:: Regenerating config file after update and install new version of Skywire
Expand Down

0 comments on commit c788c79

Please sign in to comment.