Commit 91e07cf6 authored by Olivier Langella's avatar Olivier Langella
Browse files

Added InnoSetup script files for win installer

git-svn-id: https://subversion.renater.fr/masschroq/trunk@2081 e4b6dbb4-9209-464b-83f7-6257456c460c
parent 220b507d
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "MassChroQ"
#define MyAppVersion "1.0"
#define MyAppPublisher "PAPPSO - INRA"
#define MyAppURL "http://pappso.inra.fr/bioinfo/masschroq/"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6075E1AD-ACB0-41F8-AC3D-7497E2FFBC84}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\MassChroQ
DefaultGroupName=MassChroQ
LicenseFile=C:\developpement\masschroq\LICENCE
OutputDir=C:\Documents and Settings\INRA\Bureau
OutputBaseFilename=masschroq_setup
Compression=lzma
SolidCompression=yes
SetupIconFile=C:\developpement\masschroq\doc\logo\masschroq.png
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
[Files]
Source: "C:\developpement\masschroq\win32\src\Release\masschroq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtCore4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtNetwork4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtXml4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtXmlPatterns4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\schema\masschroq.xsd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\logo\masschroq.png"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "MassChroQ"
#define MyAppVersion "1.0"
#define MyAppPublisher "PAPSO, INRA"
#define MyAppURL "http://pappso.inra.fr/bioinfo/masschroq/"
#define MyAppExeName "masschroq.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2FEBE499-EE5A-48EE-9C31-D9190A7301EA}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\developpement\masschroq\LICENCE
OutputDir=C:\Documents and Settings\INRA\Bureau
OutputBaseFilename=masschroq_setup2
ChangesAssociations=yes
ChangesEnvironment=true
Compression=lzma
SolidCompression=yes
[Registry]
Root: HKCR; Subkey: ".masschroqML"; ValueType: string; ValueName: ""; ValueData: "masschroqMLFile "; Flags: uninsdeletevalue
Root: HKCR; Subkey: "masschroqMLFile"; ValueType: string; ValueName: ""; ValueData: "masschroqML File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "masschroqMLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\masschroq.exe,0"
Root: HKCR; Subkey: "masschroqMLFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\masschroq.exe"" ""%1"""
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
Name: modifypath; Description: Add application directory to your environmental path; Flags: unchecked
[Files]
Source: "C:\developpement\masschroq\win32\src\Release\masschroq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtCore4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtNetwork4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtXml4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\src\Release\QtXmlPatterns4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\schema\masschroq.xsd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\logo\masschroq.png"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent
[Code]
const
ModPathName = 'modifypath';
ModPathType = 'user';
function ModPathDir(): TArrayOfString;
begin
setArrayLength(Result, 1)
Result[0] := ExpandConstant('{app}');
end;
#include "./modpath.iss"
// ----------------------------------------------------------------------------
//
// Inno Setup Ver: 5.3.10
// Script Version: 1.4.0
// Author: Jared Breland <jbreland@legroom.net>
// Homepage: http://www.legroom.net/software
//
// Script Function:
// Allow modification of environmental path directly from Inno Setup installers
//
// Instructions:
// Copy modpath.iss to the same directory as your setup script
//
// Add this statement to your [Setup] section
// ChangesEnvironment=true
//
// Add this statement to your [Tasks] section
// You can change the Description or Flags
// You can change the Name, but it must match the ModPathName setting below
// Name: modifypath; Description: &Add application directory to your environmental path; Flags: unchecked
//
// Add the following to the end of your [Code] section
// ModPathName defines the name of the task defined above
// ModPathType defines whether the 'user' or 'system' path will be modified
// this will default to user if anything other than user or system is set
// setArrayLength must specify the total number of dirs to be added
// Result[0] contains first directory, Result[1] contains second, etc.
// const
// ModPathName = 'modifypath';
// ModPathType = 'user';
//
// function ModPathDir(): TArrayOfString;
// begin
// setArrayLength(Result, 1)
// Result[0] := ExpandConstant('{app}');
// end;
// #include "modpath.iss"
// ----------------------------------------------------------------------------
procedure ModPath();
var
oldpath: String;
newpath: String;
updatepath: Boolean;
pathArr: TArrayOfString;
aExecFile: String;
aExecArr: TArrayOfString;
i, d: Integer;
pathdir: TArrayOfString;
regroot: Integer;
regpath: String;
begin
// Get constants from main script and adjust behavior accordingly
// ModPathType MUST be 'system' or 'user'; force 'user' if invalid
if ModPathType = 'system' then begin
regroot := HKEY_LOCAL_MACHINE;
regpath := 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
end else begin
regroot := HKEY_CURRENT_USER;
regpath := 'Environment';
end;
// Get array of new directories and act on each individually
pathdir := ModPathDir();
for d := 0 to GetArrayLength(pathdir)-1 do begin
updatepath := true;
// Modify WinNT path
if UsingWinNT() = true then begin
// Get current path, split into an array
RegQueryStringValue(regroot, regpath, 'Path', oldpath);
oldpath := oldpath + ';';
i := 0;
while (Pos(';', oldpath) > 0) do begin
SetArrayLength(pathArr, i+1);
pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);
oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath));
i := i + 1;
// Check if current directory matches app dir
if pathdir[d] = pathArr[i-1] then begin
// if uninstalling, remove dir from path
if IsUninstaller() = true then begin
continue;
// if installing, flag that dir already exists in path
end else begin
updatepath := false;
end;
end;
// Add current directory to new path
if i = 1 then begin
newpath := pathArr[i-1];
end else begin
newpath := newpath + ';' + pathArr[i-1];
end;
end;
// Append app dir to path if not already included
if (IsUninstaller() = false) AND (updatepath = true) then
newpath := newpath + ';' + pathdir[d];
// Write new path
RegWriteStringValue(regroot, regpath, 'Path', newpath);
// Modify Win9x path
end else begin
// Convert to shortened dirname
pathdir[d] := GetShortName(pathdir[d]);
// If autoexec.bat exists, check if app dir already exists in path
aExecFile := 'C:\AUTOEXEC.BAT';
if FileExists(aExecFile) then begin
LoadStringsFromFile(aExecFile, aExecArr);
for i := 0 to GetArrayLength(aExecArr)-1 do begin
if IsUninstaller() = false then begin
// If app dir already exists while installing, skip add
if (Pos(pathdir[d], aExecArr[i]) > 0) then
updatepath := false;
break;
end else begin
// If app dir exists and = what we originally set, then delete at uninstall
if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then
aExecArr[i] := '';
end;
end;
end;
// If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path
if (IsUninstaller() = false) AND (updatepath = true) then begin
SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True);
// If uninstalling, write the full autoexec out
end else begin
SaveStringsToFile(aExecFile, aExecArr, False);
end;
end;
end;
// Write file to flag modifypath was selected
// Workaround since IsTaskSelected() cannot be called at uninstall and AppName and AppId cannot be "read" in Code section
if IsUninstaller() = false then
SaveStringToFile(ExpandConstant('{app}') + '\uninsTasks.txt', WizardSelectedTasks(False), False);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
taskname: String;
begin
taskname := ModPathName;
if CurStep = ssPostInstall then
if IsTaskSelected(taskname) then
ModPath();
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
appdir: String;
aSelectedTasks: TArrayOfString;
i: Integer;
taskname: String;
begin
taskname := ModPathName;
appdir := ExpandConstant('{app}')
if CurUninstallStep = usUninstall then begin
if LoadStringsFromFile(appdir + '\uninsTasks.txt', aSelectedTasks) then
for i := 0 to GetArrayLength(aSelectedTasks)-1 do
if aSelectedTasks[i] = taskname then
ModPath();
DeleteFile(appdir + '\uninsTasks.txt');
end;
end;
function NeedRestart(): Boolean;
var
taskname: String;
begin
taskname := ModPathName;
if IsTaskSelected(taskname) and not UsingWinNT() then begin
Result := True;
end else begin
Result := False;
end;
end;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment