Files
gti d21a9d1140 Add 'fiscal/' from commit '102ba84500dbd9655a0471288c3e278652593ca9'
git-subtree-dir: fiscal
git-subtree-mainline: d95165fc8f
git-subtree-split: 102ba84500
2026-09-29 14:43:23 -03:00

31 lines
927 B
Python

"""Uninstall.exe — stops and removes the GTI Fiscal Agent service, then removes
the install directory (config, DPAPI credential, service host, state/logs) and
the ARP uninstall key. Invoked from Settings -> Apps -> GTI Fiscal Agent ->
Uninstall. Run elevated (PyInstaller --uac-admin); safe to run twice.
Never connects to the Hub and never reads the credential contents.
"""
from __future__ import annotations
import shutil
import sys
from pathlib import Path
import install_common as common
def main() -> int:
install = common.install_dir()
common.remove_service()
common.remove_arp_entry()
if install.exists():
try:
shutil.rmtree(install, ignore_errors=True)
except OSError:
pass # leftover locked handle; SCM may still hold the binary briefly
print(f"GTI Fiscal Agent removed from {install}")
return 0
if __name__ == "__main__":
sys.exit(main())