diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e1b3d95 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "filesystem": "cpp" + } +} \ No newline at end of file diff --git a/bin/iconhost.deps.json b/bin/iconhost.deps.json deleted file mode 100644 index 3d688af..0000000 --- a/bin/iconhost.deps.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETCoreApp,Version=v8.0", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETCoreApp,Version=v8.0": { - "iconhost/1.0.0": { - "runtime": { - "iconhost.dll": {} - } - } - } - }, - "libraries": { - "iconhost/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - } - } -} \ No newline at end of file diff --git a/bin/iconhost.exe b/bin/iconhost.exe deleted file mode 100644 index bbd09de..0000000 Binary files a/bin/iconhost.exe and /dev/null differ diff --git a/bin/iconhost.pdb b/bin/iconhost.pdb deleted file mode 100644 index ae267ec..0000000 Binary files a/bin/iconhost.pdb and /dev/null differ diff --git a/bin/iconhost.runtimeconfig.json b/bin/iconhost.runtimeconfig.json deleted file mode 100644 index becfaea..0000000 --- a/bin/iconhost.runtimeconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net8.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "8.0.0" - }, - "configProperties": { - "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false - } - } -} \ No newline at end of file diff --git a/config.json b/config.json index ed10df9..0e1c481 100644 --- a/config.json +++ b/config.json @@ -10,5 +10,6 @@ "idlingImageStyle": "nostalgia-1", "alwaysFullReload": false, "searchEngine": "youtube", - "discordRpcEnabled": true + "discordRpcEnabled": true, + "useWic" : true } \ No newline at end of file diff --git a/helpers/core/commandProcessor.js b/helpers/core/commandProcessor.js index e4e1b9b..013badc 100644 --- a/helpers/core/commandProcessor.js +++ b/helpers/core/commandProcessor.js @@ -120,23 +120,11 @@ export async function processCommand(command) { killAudioProcesses() process.exit() break; - case 'about': - const useWinIconLauncher = (() => { - if (process.platform === 'win32') { - try { - const dotNetInfo = execSync('dotnet --info') - if (dotNetInfo.toString().includes('8.')) { - return true - } - } catch (e) {} - } - return false - })() - - if (useWinIconLauncher) { - spawn(`${getCrossPlatformString("new-terminal-window")} iconhost.exe about`, [], { + case 'about': + if (config['useWic']) { + spawn(`${getCrossPlatformString("new-terminal-window")} winIconLauncher.exe about`, [], { shell: true, - cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), '../', '../', 'bin') + cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), '../', '../', 'wic') }) } else { spawn(`${getCrossPlatformString("new-terminal-window")} node ${directory} about`, [], {shell: true}) diff --git a/bin/iconhost.dll b/images/icon.ico similarity index 58% rename from bin/iconhost.dll rename to images/icon.ico index 65b6961..88827f4 100644 Binary files a/bin/iconhost.dll and b/images/icon.ico differ diff --git a/launch/launcher.js b/launch/launcher.js index 6729a03..6d08cab 100644 --- a/launch/launcher.js +++ b/launch/launcher.js @@ -4,6 +4,7 @@ import { fileURLToPath } from 'url'; import path from 'path'; import { Green, Magenta, PastelGreen, PastelRed, Red, Reset, Yellow } from '../helpers/misc/colorCodes.js'; import { checkForUpdates } from '../helpers/startup/updateChecker.js' +import { config } from '../snippets/config.js'; const directory = path.join(path.dirname(fileURLToPath(import.meta.url)), '../', 'termusic.js') @@ -36,31 +37,12 @@ export async function startLauncher() { } else { console.log(`[${PastelGreen}DONE${Reset}]`) } - - const useWinIconLauncher = (() => { - if (process.platform === 'win32') { - process.stdout.write('Checking whether winIconLauncher can be used ') - try { - const dotNetInfo = execSync('dotnet --info') - - if (dotNetInfo.toString().includes('8.')) { - console.log(`[${PastelGreen}DONE${Reset}]`) - return true - } else { - console.log(`[${PastelRed}.NET 8.0 NOT FOUND${Reset}]`) - } - } catch (e) { - console.log(`[${PastelRed}NO .NET RUNTIMES FOUND${Reset}]`) - } - } - return false - })() process.stdout.write('Launching termusic in a seperate window ') - if (useWinIconLauncher) { - spawn(`${getCrossPlatformString("new-terminal-window")} iconhost.exe launch`, [], { + if (config['useWic']) { + spawn(`${getCrossPlatformString("new-terminal-window")} winIconLauncher.exe launch`, [], { shell: true, - cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), '../', 'bin') + cwd: path.join(path.dirname(fileURLToPath(import.meta.url)), '../', 'wic') }) } else { spawn(`${getCrossPlatformString("new-terminal-window")} node ${directory} launch`, [], {shell: true}) diff --git a/wic/readme b/wic/readme new file mode 100644 index 0000000..8ceeb1d --- /dev/null +++ b/wic/readme @@ -0,0 +1 @@ +simply compile the file winIconLauncher.cpp in your favourite compiler. The program icon is added afterwards using resource hacker and the icon file located at ./images/icon.ico \ No newline at end of file diff --git a/wic/winIconLauncher.cpp b/wic/winIconLauncher.cpp new file mode 100644 index 0000000..b03c1a8 --- /dev/null +++ b/wic/winIconLauncher.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) { + std::string path = std::filesystem::current_path().parent_path().string(); + std::string command = "cmd.exe /c node " + path + "\\termusic.js " + (argc > 1 ? argv[1] : ""); + system(command.c_str()); + return 0; +} + diff --git a/wic/winIconLauncher.exe b/wic/winIconLauncher.exe new file mode 100644 index 0000000..68b4d2c Binary files /dev/null and b/wic/winIconLauncher.exe differ