| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- ; Script de création du programme d'installation Pardit
- #define MyAppName "pardit"
- #define MyAppVersion "0.2"
- #define FileVersion "0-2"
- #define MyAppPublisher "Conseil Départemental du Bas-Rhin"
- #define MyAppURL "http://codebox/Culture-Territo-BI/pardit"
- #define MyAppLocation "C:\Applications_CD67\MRI-PARDIT\"
- #define PythonVersion "3.6-32"
- [Setup]
- AppId={{C8002CE1-D79C-4B0C-AD8A-73F43D219CD6}}
- AppName={#MyAppName}
- AppVersion={#MyAppVersion}
- AppPublisher={#MyAppPublisher}
- AppPublisherURL={#MyAppURL}
- AppSupportURL={#MyAppURL}
- AppUpdatesURL={#MyAppURL}
- DefaultDirName={#MyAppLocation}{#MyAppName}
- DefaultGroupName={#MyAppName}
- Compression=lzma
- PrivilegesRequired=lowest
- SolidCompression=yes
- VersionInfoCompany=Conseil Départemental du Bas-Rhin
- DisableDirPage=yes
- DisableProgramGroupPage=yes
- DisableFinishedPage=yes
- OutputDir=.
- OutputBaseFilename=setup-{#MyAppName}
- ChangesEnvironment=yes
- UninstallFilesDir={app}\uninstall\
- [Languages]
- Name: "french"; MessagesFile: "compiler:Languages\French.isl"
- [Files]
- Source: "ui\*"; DestDir: "{app}\ui"; Flags: ignoreversion recursesubdirs
- Source: "core\*"; DestDir: "{app}\core"; Flags: ignoreversion recursesubdirs
- Source: "bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs
- Source: "doc\*"; DestDir: "{app}\doc"; Flags: ignoreversion recursesubdirs
- Source: "templates\*"; DestDir: "{app}\templates"; Flags: ignoreversion recursesubdirs
- Source: "pardit.py"; DestDir: "{app}"; Flags: ignoreversion
- Source: "pardit.yaml"; DestDir: "{app}"; Flags: ignoreversion
- Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion
- Source: "requirements.txt"; DestDir: "{app}"; Flags: ignoreversion
- Source: "logo.png"; DestDir: "{app}"; Flags: ignoreversion
- Source: "pardit.ico"; DestDir: "{app}"; Flags: ignoreversion
- Source: "updater.py"; DestDir: "{app}"; Flags: ignoreversion
- Source: "version.txt"; DestDir: "{app}"; Flags: ignoreversion
- Source: "bin\pip67.exe"; DestDir: "{code:PythonDir}\Scripts"; Flags: onlyifdoesntexist
- [Icons]
- Name: "{group}\{#MyAppName}"; Filename: "pythonw.exe"; Parameters: "{app}\{#MyAppName}.py"; WorkingDir: "{app}"; IconFilename: "{app}\pardit.ico"
- Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
- Name: "{commondesktop}\{#MyAppName}"; Filename: "pythonw.exe"; Parameters: "{app}\{#MyAppName}.py"; WorkingDir: "{app}"; IconFilename: "{app}\pardit.ico"
- [Run]
- Filename: "pip67.exe"; Parameters: "install -r {app}\requirements.txt"; StatusMsg: "Installation des librairies complémentaires"; Flags: runhidden
- [Code]
- function PythonDir(Param: String): String;
- var
- ErrorCode: Integer;
- PythonDirpath: String;
- begin
- if RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Python\PythonCore\{#PythonVersion}\InstallPath', '', PythonDirpath) OR
- RegQueryStringValue(HKLM, 'SOFTWARE\Python\PythonCore\{#PythonVersion}\InstallPath', '', PythonDirpath) then
- begin
- Result := PythonDirpath;
- end
- else
- begin
- Result := '';
- end
- end;
- function PythonExec(Param: String): String;
- var
- PythonDirPath: String;
- PythonPath: String;
- begin
- PythonDirPath := PythonDir('');
- if DirExists(PythonDirPath) then
- begin
- Result := PythonDirPath + 'python.exe';
- end
- else
- begin
- Result := '';
- end
- end;
- function InitializeSetup(): Boolean;
- var
- PythonPath : String;
- begin
- PythonPath := PythonExec('');
- if not FileExists(PythonPath) then
- begin
- MsgBox('Python {#PythonVersion} doit être installé.' + #13#10 + 'Installation annulée.', mbError, MB_OK);
- Result := False;
- Exit;
- end
- Result := True;
- end;
|