cancel
Showing results for 
Search instead for 
Did you mean: 
toftof
Pilgrim

Embedding Python installation via exe file

Hi,

Our software package offers the user the option to install Python.

Python used to be included in my basic msi project as a chained MSI. However Python have now stopped providing MSIs and I therefore need to include it as an executable.

I haven't been able to add it as a "New EXE" custom action (deferred) because the Python installer complains that another installation is already in progress...

Is there any way to include the Python installer executable other than by including it as a prerequisite? Should the "New EXE" custom action work?


Thank you,
Christophe
Labels (1)
0 Kudos
5 Replies
Highlighted
chad_petersen
Flexera beginner

Re: Embedding Python installation via exe file

It sounds to me like the new EXE from Python includes an MSI nested inside of it. That's what is throwing the error is you have one MSI already running and when you run the EXE it sounds like it is unpacking an MSI and trying to run it. Can't have two MSI files in Execute mode at the same time in this fashion.

Chad
0 Kudos
MarkusLatz
Active participant

Re: Embedding Python installation via exe file

The Phyton package is created with WiX-Toolkit.

You can extract the sources with:

dark.exe python-3.6.2.exe -x .\out

Then all packages are extracted to "Out" folder.

Now you can use the different msi packages to bind to your msi.

But also take care that you include all necessary msi and msu packages and call with the correct parameters.

The msu packages are necessary for some OS to use VC14 (Visual C++ 2015) runtimes.

regards

Markus
0 Kudos
toftof
Pilgrim

Re: Embedding Python installation via exe file

It looks like there are around 12 extracted msi packages, and running those msi packages still did not seem to install Python correctly.

Is running an EXE custom action not possible at all?

Thanks for your replies.


Christophe
0 Kudos
DLee65
Pilgrim

Re: Embedding Python installation via exe file

Christophe,

The answer is no if the Python EXE has embedded MSI.
The solution to manage this is to create a InstallShield SUITE project. This will allow you to handle 'chaining' multiple MSI packages within a single installer.
0 Kudos
ZygoCorp
Flexera beginner

Re: Embedding Python installation via exe file

I know this won't help you per se, but I thought this might be a good place to show what we did for our InstallScript project.


// Execute Python installer
//
// Returns 0 always
//
// Called by: OnMoved()
//---------------------------------------------------------------------------
function mpx_InstallPython()
STRING szExeCmd, szMessage, szCmd, szCmdLine;
NUMBER nResult, nOptions;
begin

WriteLine(glLogFile, "Starting mpx_InstallPython().");
mpx_UnregisterScriptingServices();
mpx_RegisterScriptingServices();

szExeCmd = "msiexec.exe";
//Sprintf(szMessage, "\tszExeCmd = %s", szExeCmd);
//nResult = WriteLine(glLogFile, szMessage);
//MessageBox(szMessage, INFORMATION);

szCmd = SUPPORTDIR ^ "python-3.4.3.amd64.msi ";
//Sprintf(szMessage, "szCmd = %s", szCmd);
//nResult = WriteLine(glLogFile, szMessage);
//MessageBox(szMessage, INFORMATION);

szCmdLine = "/i " + szCmd + "/quiet /qn ALLUSERS=1 ADDLOCAL=ALL REMOVE=PrependPath,Extensions";
Sprintf(szMessage, "\tszCmdLine = %s", szCmdLine);
nResult = WriteLine(glLogFile, szMessage);
//MessageBox(szMessage, INFORMATION);

if (SYSINFO.nISOSL >= ISOSL_WINVISTA) then // vista, win7
LAAW_SHELLEXECUTEVERB = "runas";
endif;
nOptions = LAAW_OPTION_CHANGEDIRECTORY | LAAW_OPTION_FIXUP_PROGRAM | LAAW_OPTION_WAIT | LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_SHOW_HOURGLASS | LAAW_OPTION_HIDDEN;
nResult = LaunchApplication(szExeCmd, szCmdLine, "", SW_HIDE, LAAW_PARAMETERS.nTimeOut, nOptions);
if (nResult < 0) then
Sprintf(szMessage, "\tPython was NOT installed properly!!");
nResult = WriteLine(glLogFile, szMessage);
//MessageBox(szMessage, SEVERE);
else
Sprintf(szMessage, "\tPython WAS installed properly.");
nResult = WriteLine(glLogFile, szMessage);
endif;

return nResult;
end;
0 Kudos