Commit 7d7495b2 authored by Langella Olivier's avatar Langella Olivier
Browse files

remove old win32 directory

parent 6b77ffb5
......@@ -3,7 +3,7 @@ Name=MassChroQ GUI 2.2.23
Categories=Education;Science;Math;
Comment=MassChroQ GUI launcher
Exec=masschroq_gui %U
Icon=/usr/share/masschroq/masschroq.svg
Icon=/usr/local/share/masschroq/masschroq.svg
Terminal=false
Type=Application
StartupNotify=true
......@@ -3,7 +3,7 @@ Name=MassChroQ Studio 2.2.23
Categories=Education;Science;Math;
Comment=MassChroQ parameters editor
Exec=masschroq_studio %U
Icon=/usr/share/masschroq/masschroq.svg
Icon=/usr/local/share/masschroq/masschroq.svg
Terminal=false
Type=Application
StartupNotify=true
MassChroQ: Mass Chromatogram Quantification software.
Copyright (C) 2010 Benoit Valot, Olivier Langella, Edlira Nano, Michel Zivy.
Licence:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
The OBI-Warp alignment library in MassChroQ is copyright The University
of Texas at Austin("U.T. Austin") under the following licence:
Software by John T. Prince under the direction of Edward M. Marcotte.
By using this software the USER indicates that he or she has read,
understood and will comply with the following:
U. T. Austin hereby grants USER permission to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of this
software and its documentation for any purpose and without fee,
provided that a full copy of this notice is included with the software
and its documentation.
Title to copyright to this software and its associated documentation
shall at all times remain with U. T. Austin. No right is granted to
use in advertising, publicity or otherwise any trademark, service
mark, or the name of U. T. Austin.
This software and any associated documentation are provided "as is,"
and U. T. AUSTIN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESSED OR
IMPLIED, INCLUDING THOSE OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE, OR THAT USE OF THE SOFTWARE, MODIFICATIONS, OR
ASSOCIATED DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS,
TRADEMARKS OR OTHER INTELLECTUAL PROPERTY RIGHTS OF A THIRD
PARTY. U. T. Austin, The University of Texas System, its Regents,
officers, and employees shall not be liable under any circumstances
for any direct, indirect, special, incidental, or consequential
damages with respect to any claim by USER or any third party on
account of or arising from the use, or inability to use, this software
or its associated documentation, even if U. T. Austin has been advised
of the possibility of those damages.
Submit software operation questions to: Edward M. Marcotte, Department
of Chemistry and Biochemistry, U. T. Austin, Austin, Texas 78712.
# cd buildwin32
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../win32/Toolchain-mingw32.cmake ..
# scp index.html tryphon@bioinformatics.org:~/public_html/populations
#
SET (MINGW32 1)
#SET (WIN32 1)
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
SET (WINDAUBE_ENV_PATH /opt/win32)
# it worked on 27 nov 2013 :
# download and install from http://download.qt-project.org/archive/qt/4.8/4.8.2/ the mingw32 version
#SET(QMAKE_PREFIX /usr/bin/qmake-qt4 -spec win32-crossCompil-g++ CONFIG=release)
#SET(QT_PREFIX /usr/local/src/mingw32_f15/qt-4.7.1/i686-pc-mingw32/sys-root/mingw)
#SET(QT_PREFIX /usr/local/src/mingw_qt/usr/i686-pc-mingw32/sys-root/mingw)
SET(QT_PREFIX ${WINDAUBE_ENV_PATH}/Qt)
#SET(QWT_PREFIX /usr/local/src/mingw32_f15/qwt-5.2.1/i686-pc-mingw32/sys-root/mingw)
#SET(QWT_PREFIX /usr/local/src/mingw_qwt/usr/i686-pc-mingw32/sys-root/mingw)
SET(QWT_PREFIX ${WINDAUBE_ENV_PATH}/qwt-5.2.2)
#SET(QT_MOC_EXECUTABLE /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/moc)
#SET(QMAKE_UIC /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/uic)
#SET(QMAKE_RCC /usr/local/src/QtSDK/Desktop/Qt/4.8.1/gcc/bin/rcc)
# specify the cross compiler
#SET(CMAKE_C_COMPILER /usr/local/src/mingw32_f15/gcc-4.5.3/bin/i686-pc-mingw32-gcc)
#SET(CMAKE_CXX_COMPILER /usr/local/src/mingw32_f15/gcc-c++-4.5.3/bin/i686-pc-mingw32-g++)
#SET(CMAKE_RC_COMPILER /usr/bin/i586-mingw32msvc-windres)
SET(CMAKE_C_COMPILER /usr/bin/i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/i586-mingw32msvc-g++)
SET(CMAKE_RC_COMPILER /usr/bin/i586-mingw32msvc-windres)
# where is the target environment
#http://qt.nokia.com/downloads/windows-cpp
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${QT_PREFIX} ${QWT_PREFIX})
#SET(CMAKE_FIND_ROOT_PATH /usr/local/src/mingw32_f15/glibc-2.13 /usr/local/src/mingw32_f15/gcc-4.5.3/i686-pc-mingw32/sys-root/mingw ${QT_PREFIX} ${QWT_PREFIX})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#--enable-auto-import
#set(CMAKE_EXE_LINKER_FLAGS
#"${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-auto-import"
#)
# remove console
#set(CMAKE_EXE_LINKER_FLAGS
#"${CMAKE_EXE_LINKER_FLAGS} -Wl,--subsystem,windows"
#)
#set(
#CMAKE_SHARED_LIBRARY_CXX_FLAGS
#"${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -Wl,--enable-auto-import "
#)
#set(
#CMAKE_SHARED_LIBRARY_CXX_FLAGS
#"${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -shared -Wl,--subsystem,windows -DDLL"
#)
set(Qwt5_INCLUDE_DIR ${QWT_PREFIX}/src)
set(Qwt5_Qt4_LIBRARY ${QWT_PREFIX}/lib)
SET( Qwt5_Qt4_FOUND TRUE )
SET( Qwt5_Qt4_TENTATIVE_LIBRARY ${Qwt5_Qt4_LIBRARY}/libqwt5.a )
set(QT_HEADERS_DIR ${QT_PREFIX}/include)
set(QT_LIBRARY_DIR ${QT_PREFIX}/lib)
set(QT_QTCORE_LIBRARY ${QT_PREFIX}/lib/libQtCore4.a)
set(QT_QTCORE_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtCore4.a)
set(QT_QTCORE_INCLUDE_DIR ${QT_PREFIX}/include/QtCore)
set(QT_QTXML_LIBRARY ${QT_PREFIX}/lib/libQtXml4.a)
set(QT_QTXML_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtXml4.a)
set(QT_QTXML_INCLUDE_DIR ${QT_PREFIX}/include/QtXml)
set(QT_QTGUI_LIBRARY ${QT_PREFIX}/lib/libQtGui4.a)
set(QT_QTGUI_LIBRARY_RELEASE ${QT_PREFIX}/lib/libQtGui4.a)
set(QT_QTGUI_INCLUDE_DIR ${QT_PREFIX}/include/QtGui)
set(QT_QTXMLPATTERNS_LIBRARY ${QT_PREFIX}/lib/libQtXmlPatterns4.a)
set(QT_QTXMLPATTERNS_RELEASE ${QT_PREFIX}/lib/libQtXmlPatterns4.a)
set(QT_QTXMLPATTERNS_INCLUDE_DIR ${QT_PREFIX}/include/QtXmlPatterns)
#set(QT_BINARY_DIR ${QT_PREFIX}/bin)
#set(QT_LIBRARY_DIR ${QT_PREFIX}/lib)
#set(QT_QTCORE_LIBRARY ${QT_PREFIX}/lib/libQtCore4.a)
#set(QT_QTCORE_INCLUDE_DIR ${QT_PREFIX}/include/QtCore)
#set(QT_MOC_EXECUTABLE ${QT_PREFIX}/moc)
#set(QT_QMAKE_EXECUTABLE ${QT_PREFIX}/qmake)
#set(QT_UIC_EXECUTABLE ${QT_PREFIX}/uic)
; MassChroQ Inno Setup file to build setup installer for windows
;
; MassChroQ: Mass Chromatogram Quantification software.
; Copyright (C) 2010 Benoit Valot, Olivier Langella, Edlira Nano, Michel Zivy.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
; Definition of precompilation variables
#define MyAppName "MassChroQ"
#define MyAppVersion "1.2"
#define MyAppPublisher "PAPPSO"
#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\win32\LICENCE
OutputDir=C:\developpement\masschroq\win32
OutputBaseFilename=masschroq_setup
; set this to true if you want to perform file associations in the registry
ChangesAssociations=true
; set this to true if you want to change environment variables
ChangesEnvironment=true
; permissions to run/write/read everyone
PrivilegesRequired=none
Compression=lzma
SolidCompression=yes
; Changes in registry
[Registry]
; File association
Root: HKCR; Subkey: ".masschroqML"; ValueType: string; ValueName: ""; ValueData: "masschroqMLFile "; Flags: uninsdeletevalue; Tasks: addextension
Root: HKCR; Subkey: "masschroqMLFile"; ValueType: string; ValueName: ""; ValueData: "masschroqML File"; Flags: uninsdeletekey; Tasks: addextension
Root: HKCR; Subkey: "masschroqMLFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue; Tasks: addextension
Root: HKCR; Subkey: "masschroqMLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\masschroq.ico,0"; Flags: uninsdeletevalue; Tasks: addextension
;Setup choice languages
[Languages]
Name: "english"; MessagesFile: "compiler:Default.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]
; Propose choice of these tasks to the user during setup. Put Flags: unchecked if you
; want teh boxes to be unchecked by default. Put nothing if you want them checked.
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: modifypath; Description: Add application directory to your environmental path (recommended)
Name: addextension; Description: Associate .masschroqML file extension with MassChroQ (recommended)
; Dirs
[Dirs]
Name: "{app}\"; Permissions: everyone-modify
; Files to install
[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-1.2.xsd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\logo\masschroq.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\win32\masschroq_readme.pdf"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\developpement\masschroq\doc\examples\*.*"; DestDir: "{app}\examples\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\developpement\masschroq\doc\manual\masschroq_manual.pdf"; DestDir: "{app}"; Flags: ignoreversion
;NOTE: Don't use "Flags: ignoreversion" on any shared system files
; Shortcuts to add
[Icons]
; Start shortcuts
Name: "{group}\masschroq_readme.pdf"; Filename: "{app}\masschroq_readme.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\examples"; Filename: "{app}\examples"
Name: "{group}\masschroq_manual.pdf"; Filename: "{app}\masschroq_manual.pdf"
; Desktop shortcuts
Name: "{commondesktop}\masschroq_readme.pdf"; Filename: "{app}\masschroq_readme.pdf"; Tasks: desktopicon
Name: "{commondesktop}\masschroq_examples"; Filename: "{app}\examples"; Tasks: desktopicon
[Run]
Filename: "{app}\masschroq_readme.pdf"; Flags: postinstall shellexec skipifsilent; Description: "View the MassChroQ README file"
; Code to modify PATH env. variable. Uses file modpath.iss which you should provide
[Code]
const
ModPathName = 'modifypath';
ModPathType = 'user';
function ModPathDir(): TArrayOfString;
begin
setArrayLength(Result, 1)
Result[0] := ExpandConstant('{app}');
end;
#include "modpath.iss"
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[paper=a4paper]{geometry}
\usepackage[hks,pantone]{spotcolor}
\usepackage{color}
\usepackage{hyperref}
\hypersetup{
linktocpage,
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=blue
}
\newcommand{\M}{MassChroQ}
\newcommand{\Mv}{MassChroQ v.1.2}
\newcommand{\mexe}{\texttt{masschroq.exe}}
\newcommand{\sitemasschroq}{http://pappso.inra.fr/bioinfo/masschroq/}
\newcommand{\sitepappso}{http://pappso.inra.fr/}
\begin{document}
\title{\color{blue}\parbox[t]{\textwidth}{\centering Readme file for \\
MassChroQ version 1.2 - \emph{Longteeth Crocklet}}}
\date{}
\maketitle
Congratulations! MassChroQ version 1.2, called \emph{Longteeeth Crocklet},
is now installed on your Windows system.
\section*{What is new in {\Mv}?}
\subsection*{The post-matching feature}
The main novelty in {\Mv} is the introduction of the peptide peak post-matching feature.
Indeed, before version $1.2$, {\M} performed peak
matching during peptide quantification peak by peak. The post-matching mode
adds a peak matching step at the end of the quantification in each
group: for each peptide to be quantified, its previously unmatched
peaks are rematched by taking into account the
retention times of the previously matched peaks of this peptide in the
group. This gives a finer retention time computation for each
peptide, and allows matching of previously missed peaks in some cases. The peak post-matching mode is recommended only in high resolution experiments.
For more details on the post-matching mode and when to use it, see the MassChroQ manual
that comes with your installation.
\subsection*{The comparison result file}
The \emph{tsv} result files produced by {\M} are well suited for
automatic statistical analysis in external tools, like the \emph{R}
software. But they are not well suited for simple manual or visual
overview or comparison purposes. Therefore, in version $1.2$, a new type of
\emph{tsv} result file has been added: the \emph{comparison result
file}. The comparison result file is well suited for immediate visual
comparison of results and simple manual statistical analysis on them.
The comparison type of file is automatically generated with the
other old \emph{tsv} result files, this means that when the user
chooses to export the quantification results in \emph{tsv} format,
from now on this has the effect of creating three \emph{tsv} files :
the \emph{\_pep}, the \emph{\_prot} and the \emph{\_compar} extension
files.
\subsection*{New masschroqML schema}
The masschroqML schema has changed in {\Mv}: the current
schema version being $1.2$ (the same version number as
MassChroQ). Older masschroqML files stay functional with the new
schema, but new masschroqML files (containing the post matching
feature for example) will not work with older schema and MassChroQ versions.
\section*{Running {\M}}
Your MassChroQ installation directory contains:
\begin{itemize}
\item the \emph{manual}, explaining MassChroQ features and use.
\item the \emph{masschroq\_examples} directory, containing various
ready-to-use examples. MassChroQ input files are xml
files with the \emph{.masschroqML} extension.
\item the MassChroQ's command-line executable called \emph{masschroq.exe}.
\end{itemize}
You can run MassChroQ in two ways:
\begin{itemize}
\item by double-clicking on your \emph{.masschroqML} file. The first time
you will do this you may have to explicitly tell your Windows system to
open this file with MassChroQ. For this, right-click on your
masschroqML file, choose "Open with" and then choose MassChroQ.
\item for a more advanced use of MassChroQ (with options)
open a command-prompt:
\begin{itemize}
\item click on $start \rightarrow Run$;
\item type \texttt{cmd} on the Run window that appeared, and then press
\texttt{OK}.
\end{itemize}
A console command-line window appears. To run masschroq, you type in it:
\begin{verbatim}
masschroq path_to_input_file\input_file.masschroqML
\end{verbatim}
where \texttt{input\_file.masschroqML} is the
input file of your analysis and \\
\texttt{path\_to\_input\_file} is the
path to the directory where your input file is located
(e.g. \verb!C:\Documents\analysis!). You can also
use the \emph{cd} command to place yourself directly in this
directory by typing: \verb!cd C:\Documents\analysis!
in the command line. You can then launch masschroq directly on your
input file by typing: \verb!masschroq input_file.masschroqML!
\end{itemize}
\section*{About {\M}}
MassChroQ is an open-source software released under the
\href{http://www.gnu.org/licenses/gpl.html}{Gnu General Public Licence
version 3}. It is developed at the
\href{\sitepappso}{PAPPSO} (Paris South-West Proteomics Analysis
Platform) team by:
\begin{description}
\item Beno\^it Valot \url{benoit.valot@moulon.inra.fr}
\item Olivier Langella \url{olivier.langella@moulon.inra.fr}
\item Edlira Nano \url{edlira.nano@moulon.inra.fr}
\item Michel Zivy \url{michel.zivy@moulon.inra.fr}
\end{description}
Linux versions of MassChroQ (including packages for Debian and Ubuntu
32 and 64 bits) are of course available, so do not hesitate to install Linux
on your system (it's very user-friendly nowadays) because of
MassChroQ :)
On the {\M} homepage at \\
\url{\sitemasschroq}\\
you can find documentation, example files and
the latest news about this project.
On the {\M} development page hosted by SourceSup at\\
\url{http://sourcesup.renater.fr/projects/masschroq/}\\
you will find a subversion repository, a bug tracker and various forums.
The source code is anonymously available via direct access to the
subversion repository from \url{https://subversion.renater.fr/masschroq/}.
Feel free and very welcomed to contribute to the {\M} project by
directly contacting one of its authors.
\end{document}
\ No newline at end of file
// ----------------------------------------------------------------------------
//
// 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;