Skip to content

Commit

Permalink
Added more programs
Browse files Browse the repository at this point in the history
  • Loading branch information
xXZeNullXx committed May 26, 2023
1 parent 13f4056 commit a285d17
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.vscode/settings.json
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Programs

```git
git pull https://github.com/xXZeNullXx/Programs.git
git clone https://github.com/xXZeNullXx/Programs.git
```
63 changes: 52 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,47 @@
# Define the programs to install
programs = {
"7Zip": "7zip.7zip",
"Brave": "Brave.Brave"
"VSCode" "Microsoft.VisualStudioCode"
"Brave": "Brave.Brave",
"VSCode": "Microsoft.VisualStudioCode",
"Discord": "Discord.Discord",
"TeraCopy": "CodeSector.TeraCopy",
"GitHub Desktop": "GitHub.GitHubDesktop",
"Logitech G HUB": "Logitech.GHUB",
"CurseForge": "Overwolf.CurseForge",
"MobaXterm": "Mobatek.MobaXterm",
"Playnite": "Playnite.Playnite",
"Acrobat Reader": "Adobe.Acrobat.Reader.64-bit",
"Elgato StreamDeck": "Elgato.StreamDeck",
"Flow-Launcher": "Flow-Launcher.Flow-Launcher",
"EpicGames": "EpicGames.EpicGamesLauncher",
"PowerToys": "Microsoft.PowerToys",
"EADesktop": "ElectronicArts.EADesktop",
"GOG Galaxy": "GOG.Galaxy",
"Teams": "Microsoft.Teams",
"GIMP": "GIMP.GIMP",
"Bitwarden": "Bitwarden.Bitwarden",
"Notepad++": "Notepad++.Notepad++",
"IrfanView": "IrfanSkiljan.IrfanView",
"HWiNFO": "REALiX.HWiNFO",
"ONLYOFFICE": "ONLYOFFICE.DesktopEditors",
"Nilesoft Shell": "Nilesoft.Shell",
"VLC": "VideoLAN.VLC",
"Rufus": "Rufus.Rufus",
"Everything": "voidtools.Everything",
"Espanso": "Espanso.Espanso",
"snaketail": "snakefoot.snaketail",
"Rainmeter": "Rainmeter.Rainmeter",
"Greenshot": "Greenshot.Greenshot",
"flux": "flux.flux",
}

# Check if the programs are already installed
ps_command = 'winget list'
installed_programs = subprocess.check_output(['powershell', '-Command', ps_command]).decode().splitlines()
ps_command = "winget list"
installed_programs = (
subprocess.check_output(["powershell", "-Command", ps_command])
.decode()
.splitlines()
)
for program_name in programs.keys():
if any(program_name.lower() in program.lower() for program in installed_programs):
programs[program_name] = None # Set to None to hide the button
Expand All @@ -30,14 +64,21 @@
if event in programs.keys() and programs[event] is not None:
# Run the PowerShell command to install the selected program
program_id = programs[event]
ps_command = f'winget install --id={program_id} -e'
subprocess.call(['powershell', '-Command', ps_command])
ps_command = f"winget install --id={program_id} -e"
subprocess.call(["powershell", "-Command", ps_command])

# Re-check if the installed program to update the button status
ps_command = 'winget list'
installed_programs = subprocess.check_output(['powershell', '-Command', ps_command]).decode().splitlines()
ps_command = "winget list"
installed_programs = (
subprocess.check_output(["powershell", "-Command", ps_command])
.decode()
.splitlines()
)
for program_name in programs.keys():
if any(program_name.lower() in program.lower() for program in installed_programs):
if any(
program_name.lower() in program.lower()
for program in installed_programs
):
programs[program_name] = None
else:
programs[program_name] = f"{program_name}"
Expand All @@ -52,4 +93,4 @@
if event == sg.WIN_CLOSED:
break

window.close()
window.close()

0 comments on commit a285d17

Please sign in to comment.