简体   繁体   English

使用 Inno Setup 创建带有参数的 exe 桌面快捷方式

[英]Create desktop shortcut to exe with argument with Inno Setup

I'm trying to create an installer for a Python script with Inno Setup.我正在尝试使用 Inno Setup 为 Python 脚本创建安装程序。 My goal is to have a single installer.我的目标是拥有一个安装程序。

With Inno Setup, I packed my Python script, an embedded version of Python, and an icon.使用 Inno Setup,我打包了我的 Python 脚本、Python 的嵌入式版本和一个图标。

But I don't figure how to tell to Inno Setup that my app is a .exe with an argument like:但我不知道如何告诉 Inno Setup 我的应用程序是一个带有如下参数的 .exe:

.\python.exe .\myScript.py

I want to create an icon that will execute ".\python.exe .\myScript.py"我想创建一个将执行".\python.exe .\myScript.py"的图标

Is there any way to do this?有没有办法做到这一点?

To create a desktop icon that will execute installed python.exe with your script as an argument, add an entry to [Icons] section of your Inno Setup script:要创建一个桌面图标,以脚本作为参数执行已安装的python.exe ,请在 Inno Setup 脚本的[Icons]部分添加一个条目:

[Icons]
Name: "{autodesktop}\My Program"; Filename: "python.exe"; \
    Parameters: ".\myScript.py"; WorkingDir: "{app}"

Have you compiled your python file to a .exe?您是否已将您的 python 文件编译为 .exe? Or is it a .py?还是.py? The best way to setup Inno Setup is to use its inbuilt installer creation wizard.设置 Inno Setup 的最佳方法是使用其内置的安装程序创建向导。 It steps you through exactly what you need to do.它会逐步指导您完成您需要做的事情。 Then you can go back in and change the code after if you're not happy.然后,如果您不满意,您可以返回并更改代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM