Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Windows-Standalone/install_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
"version": "41.0.0",
"installed": "Yes",
"installed_date": "2025-02-24 14:19:53",
"install_directory": "E:\\Capstone Project\\ToolManager(Task2)\\Application_Venv\\tools\\ngspice"
"install_directory": "C:\\Users\\Admin\\Desktop\\eSim\\Windows-Standalone\\tools\\ngspice"
},
{
"package_name": "kicad",
"version": "-",
"installed": "No",
"installed_date": "-",
"install_directory": "-"
"version": "9.0.7",
"installed": "Yes",
"installed_date": "2026-03-10 00:50:53",
"install_directory": "C:\\Users\\Admin\\Desktop\\eSim\\Windows-Standalone\\tools\\kicad"
},
{
"package_name": "llvm",
"version": "-",
"installed": "No",
"installed_date": "-",
"install_directory": "-"
"version": "22.1.0",
"installed": "Yes",
"installed_date": "2026-03-10 00:59:39",
"install_directory": "C:\\Users\\Admin\\Desktop\\eSim\\Windows-Standalone\\tools\\llvm"
},
{
"package_name": "ghdl",
Expand All @@ -31,13 +31,13 @@
{
"package_name": "pip_packages",
"installed": "Yes",
"installed_date": "2025-01-20 12:13:18"
"installed_date": "2026-03-10 01:06:09"
},
{
"package_name": "chocolatey",
"version": "2.4.1",
"version": "2.6.0",
"installed": "Yes",
"installed_date": "2025-02-24 14:19:17",
"installed_date": "2026-03-17 19:31:42",
"install_directory": "C:\\ProgramData\\chocolatey"
}
],
Expand Down
121 changes: 90 additions & 31 deletions Windows-Standalone/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import subprocess
import json
from PyQt5 import QtWidgets, QtGui, QtCore
Expand All @@ -10,6 +11,12 @@

# Path to JSON file
JSON_FILE_PATH = os.path.join(os.getcwd(), "install_details.json")
if not os.path.exists(JSON_FILE_PATH):
with open(JSON_FILE_PATH, "w") as f:
json.dump({
"important_packages": [],
"pip_packages": []
}, f)

# Path to the external program
NGSPICE_INSTALL_PROGRAM = os.path.join(os.getcwd(), "ngspice_package_manager.py")
Expand Down Expand Up @@ -212,64 +219,116 @@ def update_status_label(self):
self.chocolatey_status_label.setText("Chocolatey Status: Not Installed")
self.chocolatey_status_label.setStyleSheet("color: red;")



def install_ngspice(self):
try:
subprocess.run(["python", NGSPICE_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "Ngspice installation started successfully!")
self.update_status_label() # Update status after installation attempt
self.status_label.setText("Installing Ngspice... Please wait")
QtWidgets.QApplication.processEvents()

subprocess.run([sys.executable, NGSPICE_INSTALL_PROGRAM], check=True)

self.status_label.setText("Ngspice Installed Successfully ✅")
QtWidgets.QMessageBox.information(self, "Success", "Ngspice installation completed!")

self.update_status_label()

except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run Ngspice installer: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An error occurred: {e}")
QtWidgets.QMessageBox.critical(self, "Error", f"Failed: {e}")





def install_kicad(self):
try:
subprocess.run(["python", KICAD_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "Kicad installation started successfully!")
self.update_status_label() # Update status after installation attempt
self.status_label.setText("Installing Kicad... Please wait")
QtWidgets.QApplication.processEvents()

subprocess.run([sys.executable, KICAD_INSTALL_PROGRAM], check=True)

self.status_label.setText("Kicad Installed Successfully ✅")
QtWidgets.QMessageBox.information(self, "Success", "Kicad installation completed!")

self.update_status_label()

except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run Kicad installer: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An error occurred: {e}")
QtWidgets.QMessageBox.critical(self, "Error", f"Failed: {e}")





def install_llvm(self):
try:
subprocess.run(["python", LLVM_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "LLVM installation started successfully!")
self.update_status_label() # Update status after installation attempt
self.status_label.setText("Installing LLVM... Please wait")
QtWidgets.QApplication.processEvents()

subprocess.run([sys.executable, LLVM_INSTALL_PROGRAM], check=True)

self.status_label.setText("LLVM Installed Successfully ✅")
QtWidgets.QMessageBox.information(self, "Success", "LLVM installation completed!")

self.update_status_label()

except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run LLVM installer: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An error occurred: {e}")
QtWidgets.QMessageBox.critical(self, "Error", f"Failed: {e}")




def install_ghdl(self):
try:
subprocess.run(["python", GHDL_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "GHDL installation started successfully!")
self.update_status_label() # Update status after installation attempt
self.status_label.setText("Installing GHDL... Please wait")
QtWidgets.QApplication.processEvents()

subprocess.run([sys.executable, GHDL_INSTALL_PROGRAM], check=True)

self.status_label.setText("GHDL Installed Successfully ✅")
QtWidgets.QMessageBox.information(self, "Success", "GHDL installation completed!")

self.update_status_label()

except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run GHDL installer: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An error occurred: {e}")
QtWidgets.QMessageBox.critical(self, "Error", f"Failed: {e}")






def install_python_packages(self):
try:
subprocess.run(["python", PYTHON_PACKAGES_INSTALL_PROGRAM], check=True)
subprocess.run([sys.executable, PYTHON_PACKAGES_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "Python packages installation started successfully!")
except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run the Python Packages GUI: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An unexpected error occurred: {e}")






def install_chocolatey(self):
try:
subprocess.run(["python", CHOCOLATEY_INSTALL_PROGRAM], check=True)
QtWidgets.QMessageBox.information(self, "Success", "Chocolatey installation started successfully!")
self.update_status_label() # Update status after installation attempt
self.status_label.setText("Installing Chocolatey... Please wait")
QtWidgets.QApplication.processEvents()

subprocess.run([sys.executable, CHOCOLATEY_INSTALL_PROGRAM], check=True)

self.status_label.setText("Chocolatey Installed Successfully ✅")
QtWidgets.QMessageBox.information(self, "Success", "Chocolatey installation completed!")

self.update_status_label()

except subprocess.CalledProcessError as e:
QtWidgets.QMessageBox.critical(self, "Error", f"Failed to run Chocolatey installer: {e}")
except Exception as e:
QtWidgets.QMessageBox.critical(self, "Error", f"An unexpected error occurred: {e}")
QtWidgets.QMessageBox.critical(self, "Error", f"Failed: {e}")





# Main function
def main():
Expand Down
3 changes: 2 additions & 1 deletion Windows-Standalone/python_package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

# Define the virtual environment name and path
venv_name = "toolmanagervenv"
venv_path = os.path.join(os.getcwd(), venv_name)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
venv_path = os.path.join(BASE_DIR, venv_name)

# Load pip packages from the JSON file
def load_pip_packages():
Expand Down
Loading