; configuration file
#include "config.iss"

; put version into name to assept multiple version installations of OpenCASCADE (if not used AppId)
#define MyAppVersion "6.3.1"
#define MyAppName "Open CASCADE Technology 6.3.1"
#define MyAppVerName "Open CASCADE Technology v.6.3.1"
#define MyAppPublisher "Open CASCADE S.A.S."
#define MyAppURL "http://www.opencascade.org"

[Setup]
; AppId could be optionally changed in scripts for major releases of product if we want to implement
; an option - update OCCT or install additionally
;AppId={F22487C3-47F0-4e72-BF3A-78401BC6F459}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=false
OutputDir={#OCC_OUTPUT}
OutputBaseFilename=occtSetup{#MyAppVersion}
;just for debug
;Compression=none
Compression=lzma/ultra
SolidCompression=true
ChangesAssociations=false
RestartIfNeededByRun=false
AlwaysShowDirOnReadyPage=true
AlwaysShowGroupOnReadyPage=true
WizardImageFile={#OCC_DESIGN}\occtSetupWizImage.bmp
WizardSmallImageFile={#OCC_DESIGN}\occtSetupWizImageSmall.bmp
SetupIconFile={#OCC_DESIGN}\icons\occtSetupICO.ico
InternalCompressLevel=normal
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
PrivilegesRequired=admin
VersionInfoDescription=Open CASCADE Technology {#MyAppVersion}
VersionInfoCompany=Open CASCADE S.A.S.
LicenseFile={#OCC_DESIGN}\license.rtf
ChangesEnvironment=true
AlwaysShowComponentsList=false
FlatComponentsList=false

[Languages]

[Tasks]
Name: setGlobalEnv; Description: Set the environment variables;

[Files]
; environment configuration batch script
Source: {#OCC_DESIGN}\OpenCASCADE\env.bat;                   DestDir: {app}\ros;
; icon file used for links
Source: {#OCC_DESIGN}\icons\opencascade.ico;                 DestDir: {app}\3rdparty\win32;                                Components: Bean_OCCT\Binaries or Bean_WOK or Bean_Samples
; 3rd party dependencies
Source: {#OCC_BUILD}\Products\Windows\TclTk\*;               DestDir: {app}\3rdparty\win32\tcltk;   Flags: recursesubdirs; Components: Bean_OCCT\Binaries or Bean_WOK
Source: {#OCC_BUILD}\Products\Windows\VS\*;                  DestDir: {app}\3rdparty\win32\vs;      Flags: recursesubdirs; Components: Bean_OCCT\Binaries or Bean_Tools\OCAFBrowser or Bean_Samples\Standard\Java or Bean_Samples\Standard\Qt or Bean_Samples\Standard\MFC or Bean_Samples\Standard\Vis or Bean_Samples\Tutorial or Bean_WOK
Source: {#OCC_BUILD}\Products\Windows\Qt\*;                  DestDir: {app}\3rdparty\win32\qt;      Flags: recursesubdirs; Components: Bean_Tools\OCAFBrowser or Bean_Samples\Standard\Qt or Bean_Samples\Standard\Vis or Bean_Samples\Tutorial
Source: {#OCC_BUILD}\Products\Windows\Java\*;                DestDir: {app}\3rdparty\win32\java;    Flags: recursesubdirs; Components: Bean_Samples\Standard\Java
; Sources bean
Source: {#OCC_BUILD}\OpenCASCADE\UDLIST;                     DestDir: {app}\ros\adm;                                       Components: Bean_OCCT\Sources or Bean_OCCT\BuildProc
Source: {#OCC_BUILD}\OpenCASCADE\LICENSE.LGPL;               DestDir: {app}\ros\adm;                                       Components: Bean_OCCT\Sources or Bean_OCCT\Binaries or Bean_OCCT\BuildProc
Source: {#OCC_BUILD}\OpenCASCADE\SourceFiles\inc\*;          DestDir: {app}\ros\inc;                Flags: recursesubdirs; Components: Bean_OCCT\Sources or Bean_OCCT\Binaries or Bean_OCCT\BuildProc
Source: {#OCC_BUILD}\OpenCASCADE\SourceFiles\drv\*;          DestDir: {app}\ros\drv;                Flags: recursesubdirs; Components: Bean_OCCT\Sources or Bean_OCCT\BuildProc
Source: {#OCC_BUILD}\OpenCASCADE\SourceFiles\src\*;          DestDir: {app}\ros\src;                Flags: recursesubdirs; Components: Bean_OCCT\Sources or Bean_OCCT\BuildProc
Source: {#OCC_BUILD}\OpenCASCADE\SourceFiles\res\*;          DestDir: {app}\ros\src;                Flags: recursesubdirs; Components: Bean_OCCT\Sources or Bean_OCCT\Binaries or Bean_OCCT\BuildProc
; Binaries bean
Source: {#OCC_BUILD}\OpenCASCADE\BinaryFiles\Windows\*;      DestDir: {app}\ros\win32;              Flags: recursesubdirs; Components: Bean_OCCT\Binaries
; Build Procedures bean
Source: {#OCC_BUILD}\OpenCASCADE\BuildProcedures\Windows\*;  DestDir: {app}\ros\adm;                Flags: recursesubdirs; Components: Bean_OCCT\BuildProc
; Documentation bean
Source: {#OCC_BUILD}\Documentation\TechnicalDocumentation\*; DestDir: {app}\doc\overview;           Flags: recursesubdirs; Components: Bean_Docs
; Tools bean
Source: {#OCC_BUILD}\Tools\SourceCodeColoring\*;             DestDir: {app}\tools;                  Flags: recursesubdirs; Components: Bean_Tools\CodeColoring
Source: {#OCC_BUILD}\Tools\OCAFBrowser\Common\*;             DestDir: {app}\tools\ocafbrowser;      Flags: recursesubdirs; Components: Bean_Tools\OCAFBrowser
Source: {#OCC_BUILD}\Tools\OCAFBrowser\Windows\*;            DestDir: {app}\tools\ocafbrowser;      Flags: recursesubdirs; Components: Bean_Tools\OCAFBrowser
; Samples bean
Source: {#OCC_BUILD}\Samples\Standard\Java\Common\*;         DestDir: {app}\samples\standard\java;  Flags: recursesubdirs; Components: Bean_Samples\Standard\Java
Source: {#OCC_BUILD}\Samples\Standard\Java\Windows\*;        DestDir: {app}\samples\standard\java;  Flags: recursesubdirs; Components: Bean_Samples\Standard\Java
Source: {#OCC_BUILD}\Samples\Standard\Qt\Common\*;           DestDir: {app}\samples\standard\qt;    Flags: recursesubdirs; Components: Bean_Samples\Standard\Qt
Source: {#OCC_BUILD}\Samples\Standard\Qt\Windows\*;          DestDir: {app}\samples\standard\qt;    Flags: recursesubdirs; Components: Bean_Samples\Standard\Qt
Source: {#OCC_BUILD}\Samples\Standard\Mfc\*;                 DestDir: {app}\samples\standard\mfc;   Flags: recursesubdirs; Components: Bean_Samples\Standard\MFC
Source: {#OCC_BUILD}\Samples\Standard\VisualizationPerformanceMeter\*; DestDir: {app}\samples\standard\graphic3ddemo; Flags: recursesubdirs; Components: Bean_Samples\Standard\Vis
Source: {#OCC_BUILD}\Samples\Standard\C#\*;                  DestDir: {app}\samples\standard\c#;    Flags: recursesubdirs; Components: Bean_Samples\Standard\Csharp
Source: {#OCC_BUILD}\Samples\Tutorial\Common\*;              DestDir: {app}\samples\tutorial;       Flags: recursesubdirs; Components: Bean_Samples\Tutorial
Source: {#OCC_BUILD}\Samples\Tutorial\Windows\*;             DestDir: {app}\samples\tutorial;       Flags: recursesubdirs; Components: Bean_Samples\Tutorial
; CAD Models bean
Source: {#OCC_BUILD}\CADmodels\*;                            DestDir: {app}\data;                   Flags: recursesubdirs; Components: Bean_CADModels
; WOK bean
Source: {#OCC_BUILD}\WorkshopOrganizationKit\Common\*;       DestDir: {app}\wok;                    Flags: recursesubdirs; Components: Bean_WOK
Source: {#OCC_BUILD}\WorkshopOrganizationKit\Windows\*;      DestDir: {app}\wok;                    Flags: recursesubdirs; Components: Bean_WOK

; TODO - line should be removed (and RunDRAWEXE.bat should be moved to {#OCC_BUILD}\OpenCASCADE\BinaryFiles\Windows\)
Source: {#OCC_DESIGN}\OpenCASCADE\win32\bin\RunDRAWEXE.bat;  DestDir: {app}\ros\win32\bin;                                 Components: Bean_OCCT\Binaries
; Samples batch scripts (should be updated in original projects)
; TODO - these lines should be removed (and updated batch scripts moved into appropriate folders in {#OCC_BUILD})
Source: {#OCC_DESIGN}\Samples\Standard\Qt\*;                 DestDir: {app}\samples\standard\qt;                           Components: Bean_Samples\Standard\Qt
Source: {#OCC_DESIGN}\Samples\Standard\Mfc\*;                DestDir: {app}\samples\standard\mfc;   Flags: recursesubdirs; Components: Bean_Samples\Standard\MFC
Source: {#OCC_DESIGN}\Samples\Standard\graphic3ddemo\*;      DestDir: {app}\samples\standard\graphic3ddemo;                Components: Bean_Samples\Standard\Vis
Source: {#OCC_DESIGN}\Samples\Standard\C#\* ;                DestDir: {app}\samples\standard\c#;                           Components: Bean_Samples\Standard\Csharp
Source: {#OCC_DESIGN}\Samples\Standard\Java\*;               DestDir: {app}\samples\standard\java;                         Components: Bean_Samples\Standard\Java
Source: {#OCC_DESIGN}\Samples\Tutorial\*;                    DestDir: {app}\samples\tutorial;                              Components: Bean_Samples\Tutorial

[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {group}\Test Harness\Draw Test Harness;     Filename: {app}\ros\win32\bin\RunDRAWEXE.bat; IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_OCCT\Binaries
Name: {group}\WOK\WOK;                            Filename: {app}\wok\site\wok.bat;             IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_WOK

; documentation
Name: {group}\Documentation\Introduction;                                  Filename: {app}\doc\overview\index.htm;          Components: Bean_Docs
Name: {group}\Documentation\Foundation Classes;                            Filename: {app}\doc\overview\fcug.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Modeling Data;                                 Filename: {app}\doc\overview\Modat.pdf;          Components: Bean_Docs
Name: {group}\Documentation\Modeling Algorithms;                           Filename: {app}\doc\overview\modalg.pdf;         Components: Bean_Docs
Name: {group}\Documentation\Shape Healing;                                 Filename: {app}\doc\overview\shape_heal.pdf;     Components: Bean_Docs
Name: {group}\Documentation\Visualization;                                 Filename: {app}\doc\overview\visu.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Application Framework\OCAF User’s Guide;       Filename: {app}\doc\overview\ocaf.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Application Framework\OCAF Function Mechanism; Filename: {app}\doc\overview\ocaf_functionmechanism_wp.pdf; Components: Bean_Docs
Name: {group}\Documentation\Application Framework\OCAF Tree;               Filename: {app}\doc\overview\ocaf_tree_wp.pdf;   Components: Bean_Docs
Name: {group}\Documentation\Application Framework\OCAF White Paper;        Filename: {app}\doc\overview\ocaf_wp.pdf;        Components: Bean_Docs
Name: {group}\Documentation\Application Framework\TObj package;            Filename: {app}\doc\overview\TObj.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Data Exchange\IGES;                            Filename: {app}\doc\overview\iges.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Data Exchange\STEP;                            Filename: {app}\doc\overview\step.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Data Exchange\XDE;                             Filename: {app}\doc\overview\xde.pdf;            Components: Bean_Docs
Name: {group}\Documentation\Test Harness;                                  Filename: {app}\doc\overview\thug.pdf;           Components: Bean_Docs
Name: {group}\Documentation\Workshop Organization Kit\CDL (Component Description Language); Filename: {app}\doc\overview\cdl.pdf; Components: Bean_Docs
Name: {group}\Documentation\Workshop Organization Kit\User’s Guide;        Filename: {app}\doc\overview\wok.pdf;            Components: Bean_Docs

; samples
Name: {group}\Samples\Standard\Java;                            Filename: {app}\samples\standard\java\RUN.bat;                                         IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\Java
Name: {group}\Samples\Standard\Qt;                              Filename: {app}\samples\standard\qt\Run.bat;                                           IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\Qt
Name: {group}\Samples\Standard\Visualization Performance Meter; Filename: {app}\samples\standard\graphic3ddemo\Run.bat;                                IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\Vis
Name: {group}\Samples\Standard\MFC\2D Attributes;               Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DAttributes.exe;            IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\2D Basic;                    Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DBasic.exe;                 IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\2D Display;                  Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DDisplay.exe;               IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\2D Face;                     Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DFace.exe;                  IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\2D Geom;                     Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DGeom.exe;                  IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\2D Selection;                Filename: {app}\samples\standard\mfc\Run.bat; Parameters: 2DSelection.exe;             IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\AIS Basic;                   Filename: {app}\samples\standard\mfc\Run.bat; Parameters: AISBasic.exe;                IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\AIS Display Mode;            Filename: {app}\samples\standard\mfc\Run.bat; Parameters: AISDisplayMode.exe;          IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\AIS Select;                  Filename: {app}\samples\standard\mfc\Run.bat; Parameters: AISSelect.exe;               IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Conversion To B-Spline;      Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Convert.exe;                 IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Display Animation;           Filename: {app}\samples\standard\mfc\Run.bat; Parameters: DisplayAnimation.exe;        IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Geometry;                    Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Geometry.exe;                IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\HLR;                         Filename: {app}\samples\standard\mfc\Run.bat; Parameters: HLR.exe;                     IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Import Export;               Filename: {app}\samples\standard\mfc\Run.bat; Parameters: ImportExport.exe;            IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Local Operations;            Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyLocalOperations.exe; IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\OCAF;                        Filename: {app}\samples\standard\mfc\10_Ocaf\Run.bat;                                  IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Plate;                       Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Plate.exe;                   IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Serialize;                   Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Serialize.exe;               IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Shape Simplification;        Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Simplify.exe;                IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Tessellate Shapes;           Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Tesselate.exe;               IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Textured Shapes;             Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TexturesExt.exe;             IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Topological Operations;      Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyOperations.exe;      IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Topology Analysis;           Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyAnalysis.exe;        IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Topology Building;           Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyBuilding.exe;        IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Topology Primitives;         Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyPrimitives.exe;      IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Topology Transformations;    Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyTransformations.exe; IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Triangulation;               Filename: {app}\samples\standard\mfc\Run.bat; Parameters: TopologyTriangulation.exe;   IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Viewer 3D;                   Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Viewer3d.exe;                IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Standard\MFC\Walkthrough;                 Filename: {app}\samples\standard\mfc\Run.bat; Parameters: Walkthrough.exe;             IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Standard\MFC
Name: {group}\Samples\Tutorial\Tutorial;                        Filename: {app}\samples\tutorial\Run.bat;                                              IconFilename: {app}\3rdparty\win32\opencascade.ico; Components: Bean_Samples\Tutorial

[Run]

[Registry]
; Environment keys (explude PATH)
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CASROOT;                   ValueData: {app}\ros;                                    Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_MDTVFontDirectory;     ValueData: {app}\ros\src\FontMFT;                        Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_LANGUAGE;              ValueData: us;                                           Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: MMGT_CLEAR;                ValueData: 1;                                            Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_EXCEPTION_PROMPT;      ValueData: 1;                                            Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_SHMessage;             ValueData: {app}\ros\src\SHMessage;                      Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_MDTVTexturesDirectory; ValueData: {app}\ros\src\Textures;                       Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_XSMessage;             ValueData: {app}\ros\src\XSMessage;                      Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_StandardDefaults;      ValueData: {app}\ros\src\StdResource;                    Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_PluginDefaults;        ValueData: {app}\ros\src\StdResource;                    Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_XCAFDefaults;          ValueData: {app}\ros\src\StdResource;                    Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_GraphicShr;            ValueData: {app}\ros\win32\bin\TKOpenGl.dll;             Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_UnitsLexicon;          ValueData: {app}\ros\src\UnitsAPI\Lexi_Expr.dat;         Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_UnitsDefinition;       ValueData: {app}\ros\src\UnitsAPI\Units.dat;             Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_IGESDefaults;          ValueData: {app}\ros\src\XSTEPResource;                  Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_STEPDefaults;          ValueData: {app}\ros\src\XSTEPResource;                  Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_XmlOcafResource;       ValueData: {app}\ros\src\XmlOcafResource;                Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_MIGRATION_TYPES;       ValueData: {app}\ros\src\StdResource\MigrationSheet.txt; Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: TCLLIBPATH;                ValueData: {app}\3rdparty\win32\tcltk\lib;               Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: TCL_LIBRARY;               ValueData: {app}\3rdparty\win32\tcltk\lib\tcl8.4;        Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: TK_LIBRARY;                ValueData: {app}\3rdparty\win32\tcltk\lib\tk8.4;         Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: TIX_LIBRARY;               ValueData: {app}\3rdparty\win32\tcltk\lib\tix8.1;        Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_StandardLiteDefaults;  ValueData: {app}\ros\src\StdResource;                    Tasks: setGlobalEnv; Flags: uninsdeletevalue
Root: HKLM; SubKey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: CSF_StandardLiteDefaults;  ValueData: {app}\ros\src\StdResource;                    Tasks: setGlobalEnv; Flags: uninsdeletevalue

[INI]
Filename: {app}\opencascade.org.url; Section: InternetShortcut; Key: URL; String: http://www.opencascade.org/

[UninstallDelete]
Type: files; Name: {app}\opencascade.org.url

[InstallDelete]
Name: {app}\;   Type: filesandordirs;
Name: {group}\; Type: filesandordirs;

[Types]
Name: full;   Description: Full Installation
Name: custom; Description: Custom Installation; Flags: iscustom

[Components]
Name: Bean_OCCT;                    Description: Open CASCADE Technology;         Types: custom full
Name: Bean_OCCT\Sources;            Description: Source Files;                    Types: custom full
Name: Bean_OCCT\Binaries;           Description: Binary Files;                    Types: custom full
Name: Bean_OCCT\BuildProc;          Description: Build Procedures;                Types: custom full
Name: Bean_Docs;                    Description: Documentation;                   Types: custom full
Name: Bean_Tools;                   Description: Tools;                           Types: custom full
Name: Bean_Tools\CodeColoring;      Description: Source Code Coloring;            Types: custom full
Name: Bean_Tools\OCAFBrowser;       Description: OCAF Browser;                    Types: custom full
Name: Bean_Samples;                 Description: Samples;                         Types: custom full
Name: Bean_Samples\Standard;        Description: Standard;                        Types: custom full
Name: Bean_Samples\Standard\Java;   Description: Java;                            Types: custom full
Name: Bean_Samples\Standard\Qt;     Description: Qt;                              Types: custom full
Name: Bean_Samples\Standard\MFC;    Description: MFC;                             Types: custom full
Name: Bean_Samples\Standard\Vis;    Description: Visualisation Performance Meter; Types: custom full
Name: Bean_Samples\Standard\Csharp; Description: C#;                              Types: custom full
Name: Bean_Samples\Tutorial;        Description: Tutorial;                        Types: custom full
Name: Bean_CADModels;               Description: CAD Models;                      Types: custom full
Name: Bean_WOK;                     Description: Workshop Organization Kit;       Types: custom full

[Code]
function ReadEnvPATHValue(): String;
begin
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', Result) then
  begin
    Result := '';
  end;
end;

function GetRosBinPath(): String;
begin
  Result := ExpandConstant('{app}') + '\ros\win32\bin;';
end;

function GetTcltkBinPath(): String;
begin
  Result := ExpandConstant('{app}') + '\3rdparty\win32\tcltk\bin;';
end;

function GetVSBinPath(): String;
begin
  Result := ExpandConstant('{app}') + '\3rdparty\win32\vs;';
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  anEnvPATHValue: String;
  aRosBinValue: String;
  aTcltkBinValue: String;
  aVSBinValue: String;
begin
  if CurStep = ssPostInstall then
  begin
    if IsTaskSelected('setGlobalEnv') then
    begin
      anEnvPATHValue := ReadEnvPATHValue();
      aRosBinValue := GetRosBinPath();
      aTcltkBinValue := GetTcltkBinPath();
      aVSBinValue := GetVSBinPath();
      if Length(anEnvPATHValue) > 0 then
      begin
        if Pos(aRosBinValue, anEnvPATHValue) = 0 then
        begin
          anEnvPATHValue := aRosBinValue + anEnvPATHValue;
        end;
        if Pos(aTcltkBinValue, anEnvPATHValue) = 0 then
        begin
          anEnvPATHValue := aTcltkBinValue + anEnvPATHValue;
        end;
        if Pos(aVSBinValue, anEnvPATHValue) = 0 then
        begin
          anEnvPATHValue := aVSBinValue + anEnvPATHValue;
        end;
      end;
      RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', anEnvPATHValue);
    end;
  end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
  anEnvPATHValue: String;
  aRosBinValue: String;
  aTcltkBinValue: String;
  aVSBinValue: String;
begin
  if CurUninstallStep = usPostUninstall then
  begin
    anEnvPATHValue := ReadEnvPATHValue();
    aRosBinValue := GetRosBinPath();
    aTcltkBinValue := GetTcltkBinPath();
    aVSBinValue := GetVSBinPath();
    if Length(anEnvPATHValue) > 0 then
    begin
      StringChangeEx(anEnvPATHValue, aRosBinValue, '', True);
      StringChangeEx(anEnvPATHValue, aTcltkBinValue, '', True);
      StringChangeEx(anEnvPATHValue, aVSBinValue, '', True);
      RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', anEnvPATHValue);
    end;
  end;
end;






