I am creating a setup from C# program successfully with Inno Setup. To run this program I need Python. Until today I asked my customers to install Python manually, since some customers are not always following my installation guide, I am getting often questions from them. Now I want to simplify the installation, so that everything is done automatically. I need to set:
- Install path of Python:
C:\Python\Python3.5.2 - Installation for all users
- Set the global environment variable for Python
C:\Python\Python3.5.2 - If all this already exist no installation needed
I tried to do this with this code, but I didn't had any success. Normal Python installation is starting unfortunately.
[Run]
Filename: "{app}\deploy\python-3.5.2.exe"; \
Parameters: "/i ""C:\Python\Python-3.5.2"" /qb! ALLUSER=1 ADDLOCAL=ALL"; \
WorkingDir: "{app}\deploy"; Flags: 32bit; Check: python_is_installed
[Code]
function python_is_installed() : Boolean;
var
key : string;
begin
{ check registry }
key := 'software\Python\Python-3.5.2\InstallPath';
Result := not RegValueExists(HKEY_LOCAL_MACHINE, Key, '');
end;
What do I do wrong?
BR Stefan