Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 9dab5a2

Browse files
committed
Compiler: Fix missing imports
1 parent 86b6430 commit 9dab5a2

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

Compiler/package.nim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ proc packageInstaller*() =
2020
echo ""
2121

2222
# Check if Python even exists
23+
var python: string = ""
2324
if execShellCmd("python --version") == 0:
24-
let python = "python"
25+
python = "python"
2526
elif execShellCmd("py --version") == 0:
26-
let python = "py"
27+
python = "py"
2728
else:
2829
stdout.styledWriteLine({styleBright}, "- [FATAL] Python not installed!\n\nWould you like to download the recommended python installer? (Y/n): ")
2930
var input: char = getch()
@@ -50,8 +51,8 @@ proc packageInstaller*() =
5051
discard execCmdEx("python-setup.exe")
5152
return
5253

53-
stdout.styledWriteLine(fgGreen, {styleBright}, "- Python installed!")
54-
echo ""
54+
stdout.styledWriteLine(fgGreen, {styleBright}, "- Python installed!")
55+
echo ""
5556

5657
# Check Python version, pyarmor no longer supports 3.11+
5758
stdout.styledWriteLine({styleBright}, "[1] Checking for Python...")
@@ -70,11 +71,12 @@ proc packageInstaller*() =
7071
discard execShellCmd(python & " -m venv NR_VENV")
7172

7273
let venvPath: string = appDirectory / "NullRAT" / "NR_VENV"
74+
let result = execCmdEx(fmt""" cmd /c \"{venvPath}\\Scripts\\activate && pip freeze\" """)
7375
var allInstalled: bool = true
7476

7577
stdout.styledWriteLine({styleBright}, "[2] Checking if packages already installed...")
7678

77-
if runInVenv(venvPath, "pip freeze") != 0:
79+
if result.exitCode != 0:
7880
echo "[FATAL] pip command failed to execute!!"
7981
sleep(2000)
8082
else:

Compiler/utils.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import std/terminal
22
import std/os
3+
import std/strformat
34

45
proc printName*() =
56
discard execShellCmd("cls")
@@ -53,4 +54,4 @@ proc cleanWorkingDir*() =
5354
removeDir("dist")
5455

5556
proc runInVenv*(venvPath: string, command: string): int =
56-
return execShellCmd(fmt"cmd /c \"{venvPath}\\Scripts\\activate && {command}\"")
57+
return execShellCmd(fmt""" cmd /c \"{venvPath}\\Scripts\\activate && {command}\" """)

0 commit comments

Comments
 (0)