-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.bat
36 lines (35 loc) · 1.21 KB
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
:: Check if running with admin privileges
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running with admin privileges...
) else (
echo Requesting admin privileges...
powershell -Command "Start-Process '%~0' -Verb runAs"
exit /b
)
:: Copy data from AppleMusic folder to new folder in user's documents
echo Copying data to new folder...
set "source=%~dp0AppleDevices"
set "dest=%userprofile%\Documents\AppleDevices"
xcopy "%source%" "%dest%" /s /i /q
:: Kills all UWP apps
taskkill /F /IM ApplicationFrameHost.exe >nul 2>&1
:: Kills Gaming Service, it likes to get in the way
powershell -Command "Stop-Service -Name GamingServices"
taskkill /f /im gamingservices.exe >nul 2>&1
:: Register AppxManifest.xml
echo Registering AppxManifest.xml...
powershell -Command "Add-AppxPackage -Register '%userprofile%\Documents\AppleDevices\AppxManifest.xml'"
taskkill /F /IM ApplicationFrameHost.exe >nul 2>&1
taskkill /f /im gamingservices.exe >nul 2>&1
:: Install dependencies
echo Installing dependencies...
for %%f in ("%~dp0*.appx") do (
echo Installing %%f...
powershell -Command "Add-AppxPackage '%%~ff'"
)
taskkill /F /IM ApplicationFrameHost.exe >nul 2>&1
:: Done!
echo Apple Devices has been installed!
pause