[GH-ISSUE #190] using exit() simple gives an error #172

Closed
opened 2026-02-26 12:20:43 +03:00 by kerem · 2 comments
Owner

Originally created by @Deagleus on GitHub (Aug 6, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/190

So this is my script which i made just for testing:
import ctypes
def isAdmin():
try:
is_admin = (os.getuid() == 0)
except AttributeError:
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
return is_admin

is_admin = isAdmin()
if not is_admin:
ctypes.windll.user32.MessageBoxW(0, "Please run as administrator.", "RustClient", 32)
quit()
When i compile it using these settings :
image
I get this error when running it:
image
Does anyone have an idea why this happens?

Originally created by @Deagleus on GitHub (Aug 6, 2021). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/190 So this is my script which i made just for testing: `import ctypes` `def isAdmin():` ` try:` ` is_admin = (os.getuid() == 0)` ` except AttributeError:` ` is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0` ` return is_admin` `is_admin = isAdmin()` `if not is_admin:` `ctypes.windll.user32.MessageBoxW(0, "Please run as administrator.", "RustClient", 32)` ` quit()` When i compile it using these settings : ![image](https://user-images.githubusercontent.com/70175289/128573609-a99f5335-fdae-4294-b62c-8b03ba45ddca.png) I get this error when running it: ![image](https://user-images.githubusercontent.com/70175289/128573691-c2605fae-74c2-4bb3-b8e6-fc6666cefa24.png) Does anyone have an idea why this happens?
kerem closed this issue 2026-02-26 12:20:43 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Aug 6, 2021):

  1. Have you run this script outside of IDLE? As in just with Python.
  2. Did you read the help post before creating this issue?
<!-- gh-comment-id:894556387 --> @brentvollebregt commented on GitHub (Aug 6, 2021): 1. Have you run this script outside of IDLE? As in just with Python. 2. Did you read the help post before creating this issue?
Author
Owner

@Deagleus commented on GitHub (Aug 27, 2021):

my bad for being dumb.

<!-- gh-comment-id:906840367 --> @Deagleus commented on GitHub (Aug 27, 2021): my bad for being dumb.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#172
No description provided.