This guide explains how to compile the YouTube Studio Pro Downloader Python script into a standalone Windows Executable (.exe) and package it into an installer using Inno Setup.
This approach ensures the end-user doesn't need to install Python, yt-dlp, or ffmpeg manually.
Before you start on your Windows build machine, ensure you have the following installed:
- Python 3.8+: Installed and added to your System PATH.
- Inno Setup: Download and install from jrsoftware.org.
- FFmpeg Windows Builds:
yt-dlprequires FFmpeg to merge high-quality video and audio (like 1080p).- Download the essentials build from gyan.dev.
- Extract
ffmpeg.exeandffprobe.exefrom thebinfolder.
Open Command Prompt or PowerShell and install the required Python dependencies:
pip install pandas yt-dlp pyinstallerCreate a dedicated build folder, for example, C:\Build\YouTubeDownloader\. Place the following files into this folder:
YT-Downloader.py(The main Python script)icon.ico(Your application icon)ffmpeg.exe(Downloaded in step 1)ffprobe.exe(Downloaded in step 1)
We will use PyInstaller to compile the python script into a single executable. Since yt-dlp is a Python module, PyInstaller will automatically package it inside the executable.
Run the following command in your build folder:
pyinstaller --noconsole --onefile --icon=icon.ico YT-Downloader.py--noconsole: Hides the background terminal window.--onefile: Packages the entire Python environment into a single.exe.--icon: Assigns your custom icon to the executable.
Once completed, navigate to the newly created dist folder. You will find YT-Downloader.exe.
To create a professional installer that extracts the executable and ffmpeg together (so yt-dlp can access FFmpeg), we use Inno Setup.
- Open Inno Setup Compiler.
- Go to File -> New and cancel the wizard.
- Paste the following script into the editor.
(Make sure to adjust the
Source:paths to match your actual folders!)
[Setup]
AppName=YouTube Studio Pro
AppVersion=1.0
DefaultDirName={autopf}\YouTube Studio Pro
DefaultGroupName=YouTube Studio Pro
OutputDir=Output
OutputBaseFilename=YouTubeStudioPro_Installer
SetupIconFile=C:\Build\YouTubeDownloader\icon.ico
Compression=lzma2
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
[Tasks]
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
[Files]
; The main executable
Source: "C:\Build\YouTubeDownloader\dist\YT-Downloader.exe"; DestDir: "{app}"; Flags: ignoreversion
; FFmpeg binaries required by yt-dlp for merging
Source: "C:\Build\YouTubeDownloader\ffmpeg.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Build\YouTubeDownloader\ffprobe.exe"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\YouTube Studio Pro"; Filename: "{app}\YT-Downloader.exe"
Name: "{group}\Uninstall YouTube Studio Pro"; Filename: "{uninstallexe}"
Name: "{commondesktop}\YouTube Studio Pro"; Filename: "{app}\YT-Downloader.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\YT-Downloader.exe"; Description: "Launch YouTube Studio Pro"; Flags: nowait postinstall skipifsilentClick the Compile button (the green play button) in Inno Setup.
Once it finishes, look inside the Output folder (created next to your .iss script). You will find YouTubeStudioPro_Installer.exe.
You're Done! You can now distribute this single Installer. When a user runs it, it will install the app and FFmpeg seamlessly, providing a desktop shortcut and a perfect yt-dlp downloading experience.