|
| 1 | +-- tovabbfejl: |
| 2 | +-- https://apple.stackexchange.com/questions/328329/is-there-a-way-via-the-command-line-to-cause-icloud-files-to-download#comment541070_387727 |
| 3 | + |
| 4 | +on is_running(appName) |
| 5 | + tell application "System Events" to (name of processes) contains appName |
| 6 | +end is_running |
| 7 | + |
| 8 | +on run {input, parameters} |
| 9 | + if input = {"shortcut"} then |
| 10 | + return input |
| 11 | + end if |
| 12 | + |
| 13 | + set wasTerminalRunning to is_running("Terminal") |
| 14 | + |
| 15 | + tell application "Terminal" |
| 16 | + set myTab to do script |
| 17 | + set myWindow to first window of (every window whose tabs contains myTab) |
| 18 | + activate |
| 19 | + |
| 20 | + -- check if homebrew is installed |
| 21 | + do script "brew --version >/dev/null 2>/dev/null || { |
| 22 | + echo \"\\nHomebrew telepítése. Majd be kell írni a felhasználói jelszót. Tovább: Enter\"; read; |
| 23 | + /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"; |
| 24 | + echo \"A Homebrew telepítése befejeződött. Tovább: Enter\"; |
| 25 | + }" in myTab |
| 26 | + delay 1 |
| 27 | + |
| 28 | + repeat until busy of myTab is false |
| 29 | + delay 1 |
| 30 | + end repeat |
| 31 | + |
| 32 | + -- check if wine is installed |
| 33 | + do script "wine --version >/dev/null 2>/dev/null || { |
| 34 | + echo \"\\nWine telepítése. Tovább: Enter\"; read; |
| 35 | + brew tap gcenx/wine && brew install wine-crossover; |
| 36 | + echo \"A Wine telepítése befejeződött, most megkísérelem megnyitni. Ha a macOS hibaüzenetet ad, akkor Mégsem-ezd le (\"Cancel\"). Ha megnyílik, akkor csukd be az ablakát és térj ide vissza. Tovább: Enter\"; read; |
| 37 | + open /Applications/Wine\\ Crossover.app; |
| 38 | + echo \"Hibaüzenetet adott (i/n)?\"; read x; |
| 39 | + if [ $x = \"i\" ]; then |
| 40 | + echo \"Jó. Most megnyitom a Rendszerbeállításokat, és a panel sarkában kattintsd ki a lakatot, majd az alsó felében lévő gombbal engedélyezd a Wine Crossover futtatását. Ekkor meg fog nyílni a Wine ablaka, amire most nincs szükség, úgyhogy majd csukd be. Ha végeztél, térj ide vissza. Tovább: Enter\"; read; |
| 41 | + open \"x-apple.systempreferences:com.apple.preference.security\"; |
| 42 | + echo \"Ha engedélyezted a Wine Crossover futtatását, nyomj Entert.\"; read; |
| 43 | + fi |
| 44 | + }" in myTab |
| 45 | + delay 1 |
| 46 | + |
| 47 | + repeat until busy of myTab is false |
| 48 | + delay 1 |
| 49 | + end repeat |
| 50 | + |
| 51 | + -- force creating a prefix |
| 52 | + do script "wine cmd /c" in myTab |
| 53 | + |
| 54 | + repeat until busy of myTab is false |
| 55 | + delay 1 |
| 56 | + end repeat |
| 57 | + |
| 58 | + -- fix flickering |
| 59 | + do script "wine REG QUERY HKCU\\\\Software\\\\Wine\\\\Mac\\ Driver /v ForceOpenGLBackingStore | grep -c Force || (wine REG ADD HKCU\\\\Software\\\\Wine\\\\Mac\\ Driver /v ForceOpenGLBackingStore /t REG_SZ /d y)" in myTab |
| 60 | + |
| 61 | + repeat until busy of myTab is false |
| 62 | + delay 1 |
| 63 | + end repeat |
| 64 | + |
| 65 | + -- check if abevjava is installed |
| 66 | + do script "if [ ! -d \"/Users/$USER/Documents/abevjava-wine/abevjava\" ]; then |
| 67 | + echo \"\\nÚgy tűnik, hogy az abevjava nincs még telepítve. Megnyitom a NAV weboldalát, ahonnan töltsd le a Windowshoz ajánlott \"abevjava_install_oracle_jre.exe\" fájlt a Downloads (Letöltések) mappádba. (A Safari alapból oda rakja.) Tovább: Enter\"; read; |
| 68 | + open https://www.nav.gov.hu/nav/letoltesek |
| 69 | + echo \"Ha letöltötted az abevjava_install_oracle_jre.exe fájlt, nyomj Entert.\"; read; |
| 70 | + echo Most elindítom az abevjava telepítőjét. A telepítő kérni fog mappákat, ahova telepíteni szeretne dolgokat. |
| 71 | + echo |
| 72 | + echo Amikor az abevjava mappáját kéri, akkor írd be neki ezt: |
| 73 | + echo Z:/Users/$USER/Documents/abevjava-wine/abevjava |
| 74 | + echo |
| 75 | + echo Amikor a felhasználói beállítások mappáját kéri, akkor pedig írd be neki ezt: |
| 76 | + echo Z:/Users/$USER/Documents/abevjava-wine/abevjava-data |
| 77 | + echo |
| 78 | + echo \"Tovább: Enter\"; read; |
| 79 | + wine ~/Downloads/abevjava_install_oracle_jre.exe |
| 80 | + fi" in myTab |
| 81 | + delay 1 |
| 82 | + |
| 83 | + repeat until busy of myTab is false |
| 84 | + delay 1 |
| 85 | + end repeat |
| 86 | + |
| 87 | + -- force recreate abevjava user config (in case if wine prefix was deleted) |
| 88 | + do script " |
| 89 | +if [ ! -f ~/.wine/drive_c/users/crossover/.abevjava/$USER.enyk ] |
| 90 | +then |
| 91 | +
|
| 92 | +wine cmd /c mkdir C:\\\\users\\\\crossover\\\\.abevjava |
| 93 | +cat <<EOT > ~/.wine/drive_c/users/crossover/.abevjava/$USER.enyk |
| 94 | +prop.usr.naplo=Z:\\Users\\\\$USER\\Documents\\abevjava-wine\\abevjava-data\\naplo |
| 95 | +prop.usr.kontroll=kontroll |
| 96 | +prop.usr.saves=mentesek |
| 97 | +prop.usr.tmp_calc=calc |
| 98 | +prop.usr.ds_sent=KR/elkuldott |
| 99 | +prop.usr.root=Z:\\Users\\\\$USER\\Documents\\abevjava-wine\\abevjava-data |
| 100 | +prop.usr.ds_dest=KR/kuldendo |
| 101 | +prop.usr.tmp=tmp |
| 102 | +prop.usr.frissitesek=Z:\\Users\\\\$USER\\Documents\\abevjava-wine\\abevjava-data\\frissitesek |
| 103 | +prop.usr.archive=archivum |
| 104 | +prop.usr.ds_src=KR/digitalis_alairas |
| 105 | +prop.usr.import=import |
| 106 | +prop.usr.settings=beallitasok |
| 107 | +prop.usr.tmp_xml=xml |
| 108 | +prop.usr.attachment=csatolmanyok |
| 109 | +prop.usr.primaryaccounts=Z:\\Users\\\\$USER\\Documents\\abevjava-wine\\abevjava-data\\torzsadatok |
| 110 | +EOT |
| 111 | +
|
| 112 | +fi |
| 113 | + " in myTab |
| 114 | + |
| 115 | + repeat until busy of myTab is false |
| 116 | + delay 1 |
| 117 | + end repeat |
| 118 | + |
| 119 | + -- launch abevjava |
| 120 | + do script "wine cmd /c 'Z:\\Users\\%USER%\\Documents\\abevjava-wine\\abevjava\\jre\\bin\\java -jar Z:\\Users\\%USER%\\Documents\\abevjava-wine\\abevjava\\abevjava.jar'" in myTab |
| 121 | + |
| 122 | + -- repeat until busy of myTab is false |
| 123 | + -- delay 1 |
| 124 | + -- end repeat |
| 125 | + |
| 126 | + -- repeat with i from 1 to the count of myWindow's tabs |
| 127 | + -- if item i of myWindow's tabs is myTab then close myWindow |
| 128 | + -- end repeat |
| 129 | + |
| 130 | + -- if wasTerminalRunning then |
| 131 | + -- else |
| 132 | + -- quit |
| 133 | + -- end if |
| 134 | + end tell |
| 135 | +end run |
| 136 | + |
0 commit comments