AnanthVivekanand / spotify-adblock

Blocking ads on desktop Spotify, crazy code ahead
GNU General Public License v3.0
269 stars 32 forks source link

Run without the cmd window keeps open (On Windows) #28

Closed pickaxe828 closed 2 years ago

pickaxe828 commented 3 years ago

It would love to see if there is a way to run this without require the cmd keeps opening because that is kinda annoying. (MITM mode)

AngryKiller commented 3 years ago

You can use a tool such as PM2 to run it as a daemon and other things, such as running it at boot, etc

pickaxe828 commented 3 years ago

You can use a tool such as PM2 to run it as a daemon and other things, such as running it at boot, etc

How about on Windows?

AngryKiller commented 3 years ago

I'm pretty sure PM2 also works on Windows

AnanthVivekanand commented 3 years ago

Hm, I've been thinking about compiling binary versions of the proxy. This would essentially wrap the node.js script with a node.js binary depending on the OS into a single binary (exe on Windows), which would make it easier to start since it wouldn't be necessary to use command line. Command line would still be needed to trust the root certification, however.

Would compiling to an exe make it easier to have it start on login? I haven't used Windows in quite a while, but I think the process is something like making a shortcut to an exe in a certain folder.

pickaxe828 commented 3 years ago

Hm, I've been thinking about compiling binary versions of the proxy. This would essentially wrap the node.js script with a node.js binary depending on the OS into a single binary (exe on Windows), which would make it easier to start since it wouldn't be necessary to use command line. Command line would still be needed to trust the root certification, however.

Would compiling to an exe make it easier to have it start on login? I haven't used Windows in quite a while, but I think the process is something like making a shortcut to an exe in a certain folder.

I added a VB script in the folder that starts the node mitm.js without opening a cmd window And I also created a shortcut to the VB script in the shell:startup folder to make sure the proxy starts every time when I turn on my computer.

jckefan commented 3 years ago

Hm, I've been thinking about compiling binary versions of the proxy. This would essentially wrap the node.js script with a node.js binary depending on the OS into a single binary (exe on Windows), which would make it easier to start since it wouldn't be necessary to use command line. Command line would still be needed to trust the root certification, however. Would compiling to an exe make it easier to have it start on login? I haven't used Windows in quite a while, but I think the process is something like making a shortcut to an exe in a certain folder.

I added a VB script in the folder that starts the node mitm.js without opening a cmd window And I also created a shortcut to the VB script in the shell:startup folder to make sure the proxy starts every time when I turn on my computer.

Mind sharing the script? Thanks

pickaxe828 commented 3 years ago

Hm, I've been thinking about compiling binary versions of the proxy. This would essentially wrap the node.js script with a node.js binary depending on the OS into a single binary (exe on Windows), which would make it easier to start since it wouldn't be necessary to use command line. Command line would still be needed to trust the root certification, however. Would compiling to an exe make it easier to have it start on login? I haven't used Windows in quite a while, but I think the process is something like making a shortcut to an exe in a certain folder.

I added a VB script in the folder that starts the node mitm.js without opening a cmd window And I also created a shortcut to the VB script in the shell:startup folder to make sure the proxy starts every time when I turn on my computer.

Mind sharing the script? Thanks

@jckefan

Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
StrArgs = "node ""D:\APP\Spotify Ad Block\spotify-adblock-macos\mitm.js"" "
oShell.Run strArgs, 0, false

Put this code in a .vbs file in the ./spotify-adblock-macos so you don't need to certify the certificates everywhere Then make a shortcut to this file in shell:startup folder So this will ad block start every time the computer starts

jckefan commented 3 years ago

Hm, I've been thinking about compiling binary versions of the proxy. This would essentially wrap the node.js script with a node.js binary depending on the OS into a single binary (exe on Windows), which would make it easier to start since it wouldn't be necessary to use command line. Command line would still be needed to trust the root certification, however. Would compiling to an exe make it easier to have it start on login? I haven't used Windows in quite a while, but I think the process is something like making a shortcut to an exe in a certain folder.

I added a VB script in the folder that starts the node mitm.js without opening a cmd window And I also created a shortcut to the VB script in the shell:startup folder to make sure the proxy starts every time when I turn on my computer.

Mind sharing the script? Thanks

@jckefan

Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
StrArgs = "node ""D:\APP\Spotify Ad Block\spotify-adblock-macos\mitm.js"" "
oShell.Run strArgs, 0, false

Put this code in a .vbs file in the ./spotify-adblock-macos so you don't need to certify the certificates everywhere Then make a shortcut to this file in shell:startup folder So this will ad block start every time the computer starts

It worked thank you so much for the script.🥰