Answer the question
In order to leave comments, you need to log in
How to make a python app installer that creates an icon on the desktop?
I already have a compiled python application, but I need to make an installer for it.
I used NSIS script , pynsist and fbs to create the installer , but the last two use NSIS and only install program files in a user-specified folder.
Basically, there is no problem in making the NSIS installer install my application in Program Files, but I want to make a desktop icon as well.
Is there a way to do this through the same NSIS or through the pynsist script and how exactly?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
This can be done while executing the program -
user_name = os.getlogin()
pythoncom.CoInitialize()
desktop = r'C:/Users/' + user_name + '/Desktop'
path = os.path.join(desktop, 'AppName.lnk')
target = path_to_file
shell = win32com.client.Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut(path)
shortcut.Targetpath = target
shortcut.WindowStyle = 1 # 7 - Minimized, 3 - Maximized, 1 - Normal
shortcut.save()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question