Skip to content

Commit 00c3fa7

Browse files
committed
build exe
1 parent 655339a commit 00c3fa7

File tree

8 files changed

+66
-42
lines changed

8 files changed

+66
-42
lines changed

.github/contributing.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +0,0 @@
1-
# Contributing Guide
2-
3-
## Requirement
4-
When we get a project, we must first install the dependencies contained in requirement.txt in the project runtime environment:
5-
6-
```bash
7-
pip install -r requirement.txt
8-
```
9-
When we want to write the dependencies in the environment into requirement.txt, we can use the freeze command:
10-
```bash
11-
pip freeze >requirements.txt
12-
```
13-
14-
## Build exe
15-
16-
```bash
17-
pyinstaller -w -i ./win/assets/img/logo.ico ./win/main.py --add-data "./win/bat/classic.bat;." --add-data "./win/bat/default.bat;." -n "win-menu-editor"
18-
```
19-
## Reference
20-
https://tkdocs.com/tutorial/

README-zh.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
# Windows 11 Classic Right-Click Menu Editor
1+
# Windows 菜单编辑器
22

33
简体中文 | [English](./README.md)
44

5-
[Contributing Guide](./.github/contributing.md)
5+
## 介绍
6+
7+
Windows 11 经典右键单击菜单编辑器。一键将你的windows11右键菜单改回windows 10旧版样式。
8+
## 环境
9+
10+
- [Python 3.10](https://www.python.org/downloads/)
11+
- [pip](https://pip.pypa.io/en/stable/)
12+
- [PyInstaller 4.7](http://www.pyinstaller.org/)
13+
14+
## 开发
15+
16+
```bash
17+
pip install pyinstaller
18+
python win/main.py
19+
```
20+
21+
## 打包
22+
23+
```bash
24+
pyinstaller -F -w -i ./win/assets/img/logo.ico ./win/main.py --add-data "./win/bat/classic.bat;bat" --add-data "./win/bat/default.bat;bat" -n "win-menu-editor" --noconfirm
25+
```
26+
## 参考
27+
28+
- [TKinter-UI](https://github.com/openHacking/TKinter-UI)
29+
- [TkDocs](https://tkdocs.com/)

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
# Windows 11 Classic Right-Click Menu Editor
1+
# Windows Menu Editor
22

33
English| [简体中文](./README-zh.md)
44

5-
[Contributing Guide](./.github/contributing.md)
5+
## Introduction
6+
7+
Windows 11 Classic Right-Click Menu Editor.Change your windows 11 right-click menu back to the old style of windows 10 with one click.
8+
## Requirement
9+
10+
- [Python 3.10](https://www.python.org/downloads/)
11+
- [pip](https://pip.pypa.io/en/stable/)
12+
- [PyInstaller 4.7](http://www.pyinstaller.org/)
13+
14+
## Develop
15+
16+
```bash
17+
pip install pyinstaller
18+
python win/main.py
19+
```
20+
21+
## Build
22+
23+
```bash
24+
pyinstaller -F -w -i ./win/assets/img/logo.ico ./win/main.py --add-data "./win/bat/classic.bat;bat" --add-data "./win/bat/default.bat;bat" -n "win-menu-editor" --noconfirm
25+
```
26+
## Reference
27+
28+
- [TKinter-UI](https://github.com/openHacking/TKinter-UI)
29+
- [TkDocs](https://tkdocs.com/)

requirements.txt

Whitespace-only changes.

setup.py

Whitespace-only changes.

win/bat/classic.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\
55
taskkill /IM explorer.exe /F
66

77
@REM Start windows explorer
8-
explorer
8+
start "" c:\windows\explorer.exe&exit
99

win/bat/default.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ reg.exe delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a
55
taskkill /IM explorer.exe /F
66

77
@REM Start windows explorer
8-
explorer
9-
8+
start "" c:\windows\explorer.exe&exit

win/main.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from tkinter import *
33
from tkinter import ttk
44
import subprocess
5-
from subprocess import Popen, PIPE, STDOUT
65

76
# reference https://stackoverflow.com/a/34466743
87
class CustomButton(Label):
@@ -94,24 +93,22 @@ def __init__(self,root):
9493
# exec bat
9594
def useClassic(self,*args):
9695

97-
# os.system(self.classic)
98-
subprocess.Popen(self.classic)
99-
100-
# not working
101-
# process = Popen(["cmd"], shell=False, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
102-
103-
# commands = ("reg.exe delete 'HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}' /f\n"
104-
# "taskkill /IM explorer.exe /F\n"
105-
# "explorer\n"
106-
# )
107-
# outs, errs = process.communicate(commands.encode("gbk"))
108-
# content = [z.strip() for z in outs.decode("gbk").split("\n") if z]
109-
# print(*content,sep="\n")
96+
# hide cmd window
97+
# reference https://stackoverflow.com/a/7006424
98+
si = subprocess.STARTUPINFO()
99+
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
100+
#si.wShowWindow = subprocess.SW_HIDE # default
101+
subprocess.call(self.classic, startupinfo=si)
110102

111103
def useDefault(self,*args):
112104

113105
# os.system(self.default)
114-
subprocess.Popen(self.default)
106+
# subprocess.Popen(self.default)
107+
108+
si = subprocess.STARTUPINFO()
109+
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
110+
#si.wShowWindow = subprocess.SW_HIDE # default
111+
subprocess.call(self.default, startupinfo=si)
115112

116113
# sets up the main application window
117114
root = Tk()

0 commit comments

Comments
 (0)