Giter Site home page Giter Site logo

Comments (7)

jojo2357 avatar jojo2357 commented on June 8, 2024

What line does the program stop executing on? If you know how, please add print statements and let me know what the absolute directory is. Is there any other strange hardware setup that may be preventing this from working? Does it work on a different drive or none of your drives?

from music-discord-rich-presence.

Anfeket avatar Anfeket commented on June 8, 2024

Ok, I'll try adding the print statements (did you mean echo? I'll try adding those) and about the location. It's on my 3rd E: drive (C: Windows, D: and E: as my game/personal storage). I don't think I have anything special set up tho. Didn't try it on D: since I don't really use it, it serves as backup. But after trying it worked on my C: drive so I think the problem is that it's trying to find groove on my E: drive where I'm running it from. I'll reply again when I get home and add the prints.

from music-discord-rich-presence.

Smaltin avatar Smaltin commented on June 8, 2024

I think the problem is that it's trying to find groove on my E: drive where I'm running it from. I'll reply again when I get home and add the prints.

I have MusicBee running on my D: drive (not my system drive) and it links just fine so it could be your filepath. I'd say give the full file path (you can cut your username out if you want) as @jojo2357 said previously.

from music-discord-rich-presence.

Anfeket avatar Anfeket commented on June 8, 2024

So, I have the app at E:\Iné veci\Groovy DcRp (README.MD and other directories are here). Also added these lines to the linker:

echo 1
set directory=%~dp0
echo 2
Pushd %directory%
echo 3

set "params=%*"
echo 4
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
echo 5

echo I need to find the location of groove music on your computer, and the easiest way to do that is to open it and see where it came from
echo 6

looks like after few tests (it started asking for admin perms too fast) it stops at 4, then if I give it admin then it just prints this:
image
OH NEVERMIND, I just ran the linker itself with admin perms and it got to the linking process. I'm a genius.
nvm, after continuing it gave this:
image
rough translation: file system error (errorcode) then this:
image
then it just closed, not sure what is the problem then. I also recommend making the linker start with admin perms.
After trying to link with Music_drp_launcher.bat it has made the scheduled tasks but didn't show the RP on discord and the drp shows this:
image
tried with groove open and closed, linked and unlinked, same response.
That's all I could do to help, gotta make up for my sleep deprivation from the school days.

from music-discord-rich-presence.

jojo2357 avatar jojo2357 commented on June 8, 2024

Okay so a few things.

The line cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B ) is supposed to ask for admin perms so your recommendation is already there, however if there is a filesystem issue then it wont work which it appears there are.

The "Detected volume` message just means nothing is playing in groove so unless something was playing, I wouldnt be concerned.

So i went back and I guess u can try this less awesome groove finder (replace your FindGroove.bat):


set directory=%~dp0
Pushd %directory%

set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

echo I need to find the location of Groove on your computer, and the easiest way to do that is to open it and see where it came from

echo Checking admin rights...
net session 1>nul 2>nul

if not '%ERRORLEVEL%'=='0' (
echo Admin rights not detected. Please run with admin perms
pause
EXIT /B
)

auditpol /set /category:{6997984C-797A-11D9-BED3-505054503030} /success:enable>nul

taskkill /im Music.UI.exe 1>nul 2>nul

echo Please ensure Groove is closed then reopen it. once you have, reopen groove and then come back here and press any key to continue
pause>nul

wevtutil qe Security /c:200 /f:text /rd:true /q:"*[System[(EventID=4688)]]">openedfiles.dat

findstr /i "Music.UI.exe" openedfiles.dat>filelocation.dat

set /p loc=<filelocation.dat

echo Groove is at %loc:~19%

set /a "result=%result%-19"

call set parsed=%loc:~19%

rem debug echo %parsed%

set /p fgiddle=<fdoogle.dat

>filelocation.dat (
echo|set /p="%parsed%%fgiddle%"
)

taskkill /im Music.UI.exe 1>nul 2>nul

del openedfiles.dat 1>nul 2>nul

if "%parsed%"=="~19" (
echo TASK FAILED. please run me again and make sure that Groove is closed when you start me.
) else (
echo task completed. Please close Grooveidk y it didnt close on its own
)

pause

That will link the same way musicbee does which requires some more user input :/. If that works then ill look into some possible changes but not exactly sure if it will in fact work

from music-discord-rich-presence.

Anfeket avatar Anfeket commented on June 8, 2024

So after running your version of the linker I got to this (opened without admin):
image
then it asked for admin and did this:
image
Not sure what it did but here it is.

After opening the linker with admin it did this:


C:\Windows\system32>set directory=E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release\

C:\Windows\system32>Pushd E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release\

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set "params="

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>cd /d "E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release\"   && (if exist "C:\Users\Anfeket\AppData\Local\Temp\getadmin.vbs" del "C:\Users\Anfeket\AppData\Local\Temp\getadmin.vbs"  )  && fsutil dirty query C:   1>nul 2>nul  || (echo Set UAC = CreateObject("Shell.Application") : UAC.ShellExecute "cmd.exe", "/k cd ""E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release\"" && E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release\FindGroove.bat ", "", "runas", 1   1>>"C:\Users\Anfeket\AppData\Local\Temp\getadmin.vbs"  && "C:\Users\Anfeket\AppData\Local\Temp\getadmin.vbs"   && exit /B  )

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>echo I need to find the location of Groove on your computer, and the easiest way to do that is to open it and see where it came from
I need to find the location of Groove on your computer, and the easiest way to do that is to open it and see where it came from

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>echo Checking admin rights...
Checking admin rights...

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>net session  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>if not '0' == '0' (
echo Admin rights not detected. Please run with admin perms
 pause
 EXIT /B
)

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>auditpol /set /category:{6997984C-797A-11D9-BED3-505054503030} /success:enable 1>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>taskkill /im Music.UI.exe  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>echo Please ensure Groove is closed then reopen it. once you have, reopen Groove and then come back here and press any key to continue
Please ensure Groove is closed then reopen it. once you have, reopen Groove and then come back here and press any key to continue

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>pause1>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>wevtutil qe Security /c:200 /f:text /rd:true /q:"*[System[(EventID=4688)]]" 1>openedfiles.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>findstr /i "Music.UI.exe" openedfiles.dat 1>filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /p loc= 0<filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>echo Groove is at C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe
Groove is at C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /a "result=-19"

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>call set parsed=C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>rem debug echo C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /p fgiddle= 0<fdoogle.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>(echo | set /p="C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe')]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;" ) 1>filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>taskkill /im Music.UI.exe  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>del openedfiles.dat  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>if "C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe" == "~19" (echo TASK FAILED. please run me again and make sure that Groove is closed when you start me. )  else (echo task completed. Please close Grooveidk y it didnt close on its own )
task completed. Please close Grooveidk y it didnt close on its own

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>pause
Press any key to continue . . .

probably because of @echo off not being there but at least there's more info.

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>pause1>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>wevtutil qe Security /c:200 /f:text /rd:true /q:"*[System[(EventID=4688)]]" 1>openedfiles.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>findstr /i "Music.UI.exe" openedfiles.dat 1>filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /p loc= 0<filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>echo Groove is at C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe
Groove is at C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /a "result=-19"

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>call set parsed=C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>rem debug echo C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>set /p fgiddle= 0<fdoogle.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>(echo | set /p="C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe')]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;" ) 1>filelocation.dat

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>taskkill /im Music.UI.exe  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>del openedfiles.dat  1>nul 2>nul

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>if "C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe" == "~19" (echo TASK FAILED. please run me again and make sure that Groove is closed when you start me. )  else (echo task completed. Please close Grooveidk y it didnt close on its own )
task completed. Please close Grooveidk y it didnt close on its own

E:\Iné veci\Groovy DcRp\GroovyRP\bin\Release>pause
Press any key to continue . . .

Then this after opening and closing Groove several times, I think it found it.
After using the linker it linked Groove, there weren't any problems except I had to run it with admin perms.
Had the same problem as here:
image
After closing Groove (I ran the linker with Groove open) I got this when it closed:
image
It's probably a bug since I have an é in the path and it didn't save properly. (It didn't) After looking at LinkWithGroove.xml I found this:

<?xml version="1.0" ?>
<!--
This sample schedules a task to start notepad.exe at a specific time.
-->
<Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
        <Date>2021-10-11T13:21:17-08:00</Date>
        <Author>jojo2357</Author>
        <Version>1.0.0</Version>
        <Description>Kills DRP for Groove when groove is closed</Description>
    </RegistrationInfo>
    <Triggers>
        <EventTrigger>
            <Enabled>true</Enabled>
            <Subscription>
                &lt;QueryList&gt;&lt;Query Id="0" Path="Security"&gt;&lt;Select Path="Security"&gt;*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and Task = 13313 and (band(Keywords,9007199254740992)) and (EventID=4689)]] and *[EventData[(Data='C:\Program Files\WindowsApps\Microsoft.ZuneMusic_10.20122.11121.0_x64__8wekyb3d8bbwe\Music.UI.exe')]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;            </Subscription>
        </EventTrigger>
    </Triggers>
    <Principals>
        <Principal id="Author">
            <RunLevel>LeastPrivilege</RunLevel>
        </Principal>
    </Principals>
    <Settings>
        <Enabled>true</Enabled>
        <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <AllowHardTerminate>true</AllowHardTerminate>
    </Settings>
    <Actions>
        <Exec>
            <Command>
E:\In‚ veci\Groovy DcRp\GroovyRP\bin\Release\KillHidden.vbs
            </Command>
        </Exec>
    </Actions>
</Task>

I have unlinked Groove (had the same problems without admin perms) and it changed the path back to In, veci so I fixed it again.
After linking and checking the path in the task scheduler and during writing this sentence I got this:
image
Didn't even open or close Groove, not sure what triggered it. I have fixed the path directly in the task scheduler.
Also, after fixing it I noticed it didn't save it with quotation marks so that could be a problem for paths with a space in them.
It didn't run automatically but after running RunHidden.vbs manually it worked and showed on Discord.
Also after closing Groove, I had to choose what to open something with, I suppose it was KillHidden.vbs so I closed the popup and did it manually. Also added run with highest privileges to make sure it would work.
After opening Groove it asked again what to open with even though I don't know what.
I looked on the internet about the problem and probably found a solution here and followed the steps.
It worked though but it wasn't hidden anymore so I found a better solution here.
Works like a charm.

Here's a small rundown:

  • Updated the finder - previous reply
  • linker used the wrong path - é wasn't saved properly
  • scheduled task couldn't open the .vbs files - used wscript.exe with arguments
    It works well now, the only thing I recommend is replacing the task scheduler files (LinkWithGrooveOpen/Close.xml) to save it with wscript.exe and the Groove location as arguments and support for characters like é but that was probably a bug on my side.
    The finder could probably be replaced with this one but made a bit more user-friendly. At least it works now. Thanks for helping though, this project is pretty cool. Hope it works well!

from music-discord-rich-presence.

jojo2357 avatar jojo2357 commented on June 8, 2024

Awaiting another user to have this error since I cannot replicate and will take a lot of effort to fix. Closing for now since there are workarounds

from music-discord-rich-presence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.