Inno Setup registers the installation package with the system service

1. I have a Python program that I want to run
2 on a computer that does not have a python environment installed. I will package the python program using Pyinstaller as a .exe application
3, and then package this application into an installation package
4 using Inno Setup. Install this installation package on the computer and set it to boot.
requirements:
1. This computer does not have python environment installed
2. This program is set to boot
3. Windows cannot pop up at startup and should be hidden, just like mysql and tomcat services

.

this is the content of my Inno Setup.iss file:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

< H1 > define MyAppName "GJGS_APP" < / H1 > < H1 > define MyAppVersion "1.5" < / H1 > < H1 > define MyAppPublisher "My Company, Inc." < / H1 > < H1 > define MyAppURL "http://www.example.com/" < H1 > define MyAppExeName "GJGS_APP.exe" < / H1 >

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId= {{B5DEB7D6-1A25-408C-90C1-AF45F08023E2}
AppName= {- sharpMyAppName}
AppVersion= {- sharpMyAppVersion}
; AppVerName= {- sharpMyAppName} {- sharpMyAppVersion}
AppPublisher= {- sharpMyAppPublisher}
AppPublisherURL= {- sharpMyAppURL}
AppSupportURL= {- sharpMyAppURL}
AppUpdatesURL= {- AppUpdatesURL=} > AppUpdatesURL= {- AppUpdatesURL=} > sharpMyAppURL {- sharpMyAppURL} > br < > < >

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:UsersAdministratorDesktopGJGSGJGS_APP.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:UsersAdministratorDesktopGJGSGJGS_APP.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don"t use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms} {- sharpMyAppName}"; Filename: "{app} {- sharpMyAppExeName}"
Name: "{commondesktop} {- sharpMyAppName}"; Filename: "{app} {- sharpMyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app} {- sharpMyAppExeName}"; Description: "{cm:LaunchProgram, {- sharpStringChange (MyAppName,"&","& &")}}"; Flags: nowait postinstall skipifsilent
Filename: "{app} {- sharpMyAppExeName}"; Parameters: "- install"
Filename: "net.exe"; Parameters: "start MyAppExeName"; Flags:runhidden

[UninstallRun]
Filename: "{app} {- sharpMyAppExeName}"; Parameters: "--uninstall"

Jul.01,2022

after two days of inquiry, I finally found a solution:
1, install pyinstaller, generate .exe application, there are many methods on the Internet
2, find the Script path under the installation directory of Python, open doc, and execute the command pyinstall-w-F project path name, where-w is an important solution command for hidden windows. For commands about pyinstaller, see https://blog.csdn.net/pipisor....
3. Install Inno Setup software
4, add
[Tasks] Name: "startupicon" to the iss file of Inno Setup; Description: "boot up"; GroupDescription: "{cm:AdditionalIcons}";
[Icons] Name: "{userstartup} {- sharpMyAppName}"; Filename: "{app} {- sharpMyAppExeName}" Tasks: startupicon
5. By shutting down and rebooting the computer, you can start the python program without popping up windows. The computer can run without installing the Python environment, because the program runs as an .exe application

.

Note that {userstartup} {- sharpMyAppName} has a slash in the middle, which cannot be displayed

.
Menu