#๐Ÿ”’ How To Achieve A Similar Result To The Windows '.exe' Installer By Building From Code in Windows

54 messages ยท Page 1 of 1 (latest)

frosty rampart
#

I need to be able to:

  1. Customize the location of the output folder for the build (Direct the build to a specific folder)
  2. Create a build with the DLLs folder and its associated DLLs
  3. Create an installation that has an identical file structure to the one created by the .exe installer.

When I build from code in Windows using the following steps:

  1. Run 'PCbuild/build.bat'
  2. Check PCBuild and amd64 folders
    I get a result like this: no DLL folder, cannot customize output folder, different file structure from the one created by the .exe installer [PCbuild_file.png, amd64_file.png, which are the images that show the folders PCBuild and amd64]

But when I use the Windows .exe installer, my result looks like this instead: has dll folder, can select output folder, and obviously different file structure from the one created by building from code [Normal_exe_build.png, which is the image that shows the Python310 folder]

How do I build from code such that I get exactly the same result as in the Windows installer? And if that is not possible, what tools do I need to use on the installation built from code to package it in exactly the same way that the build made by the Windows .exe installer is packaged?

shy doveBOT
#

@frosty rampart

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

desert cliff
#

have you run PCBuild\amd64\python_d.exe?

frosty rampart
desert cliff
#

uhhhh nvm

#

i read the instructions wrong

frosty rampart
#

Sorry, python_d.exe doesn't exist, it's because I ran the build without the debug flag.

frosty rampart
frosty rampart
# desert cliff have you run `PCBuild\amd64\python_d.exe`?

Basically, I'm trying to replicate what you can get by running the python .exe installer by building from source... I'm aware that the result is going to be different, but I also want to know what transformations/tools I must apply to get package the version built from source like the one built from the .exe installer.

desert cliff
#

sorry I am going to have to defer to the experts, I am not familiar enough in building python to be teaching anything

void hill
#

So, you're trying to build an installer like the ones downloadable from python.org?

frosty rampart
frosty rampart
void hill
shy doveBOT
#

Tools/msi/buildrelease.bat lines 4 to 6

rem This script is intended for building official releases of Python.
rem To use it to build alternative releases, you should clone this file
rem and modify the following three URIs.```
crystal furnace
#

you checked on venvs yet? it sounds like this could be what you lookin for?

frosty rampart
frosty rampart
void hill
#

If you want to install the same python version as two different ones then with this approach you'd probably have the find where the installer's version is defined and change that.

frosty rampart
#

I mean, I THINK that's what %BUILD% and OUTDIR do in the script.

void hill
shy doveBOT
#

PCbuild/pythoncore.vcxproj line 128

PLATLIBDIR="DLLs";```
void hill
#

(Why do you need this, by the way?)

shy doveBOT
#

Tools/msi/README.txt line 61

Building the Installer```
void hill
shy doveBOT
#

Tools/msi/README.txt lines 135 to 141

To manually build layouts of the installer, build one of the projects in
the bundle folder.

    msbuild bundle\snapshot.wixproj
    msbuild bundle\releaseweb.wixproj
    msbuild bundle\releaselocal.wixproj
    msbuild bundle\full.wixproj```
frosty rampart
# void hill (Why do you need this, by the way?)

2 things, mainly:

  1. Just a sense of satisfaction knowing I can actually build from source
  2. I actually need a full python installation with the DLLs to interface with another application that I didn't develop, but that I must use. I'm not allowed to modify it (work stuff), and that application will stop working/freeze if it doesn't see the DLLs and a full python installation.
#

I mean, ONE workaround I had heard was copying over the python installation and rebuilding pip separately, but it felt ersatz and shoddy - and I was worried something would go wrong.

void hill
frosty rampart
wild igloo
frosty rampart
wild igloo
frosty rampart
#

And will those versions both have DLLs?

wild igloo
#

using the prebuilt distribution is the fastest and easiest if it fulfill your requirements as you don't need to wait for the compilation and you don't need to have all the prerequisites for building python installed on your system

frosty rampart
wild igloo
# frosty rampart And will those versions both have DLLs?

they should all include DLLs as far as i know, i'm primary on linux and use the normal pyenv project which will build .so files which for dynamic linking on linux systems mostly like .dll files are on windows
i also use uv with their python-build-standalone distributions for a lot of stuff, but that is besides the point here

wild igloo
frosty rampart
wild igloo
frosty rampart
#

Absolutely the same version.

frosty rampart
#

It'd be NICE to have, but it wouldn't make work impossible if I didn't have it. But still, the need to know remains plus1 ducky_concerned

wild igloo
frosty rampart
wild igloo
shy doveBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.