Thank you very much! Quite a script you have, probably covers almost every possible case. This is very helpful.
>Here's one I use (I cut out some stuff that you probably won't need and it probably has some stuff left in that you might not need):
>
>#define MyAppName "Best Practice - Optical"
>#define MyAppVerName "Best Practice - Optical 3.1.71"
>#define MyAppPublisher "Samaan Systems Ltd."
>#define MyAppURL "
http://SamaanSystems.com"
>#define MyAppExeName "Optical.exe"
>#define MyAppVersion "3.1.71"
>
>[Setup]
>AppName={#MyAppName}
>AppVerName={#MyAppVerName}
>AppId=BPO2
>AppPublisher={#MyAppPublisher}
>AppPublisherURL={#MyAppURL}
>AppSupportURL={#MyAppURL}
>AppUpdatesURL={#MyAppURL}
>DefaultDirName={pf}\Best Practice\Optical
>AppVersion={#MyAppVersion}
>DefaultGroupName=Best Practice
>Compression=lzma
>SolidCompression=true
>OutputBaseFilename={#MyAppName} {#MyAppVersion} setup
>
>[Messages]
>BeveledLabel=© 2005 - 2016 Samaan Systems Ltd.
>
>[Types]
>Name: full; Description: Full installation
>Name: workstation; Description: Workstation installation
>Name: database; Description: Shared Files installation
>Name: custom; Description: Custom installation; Flags: iscustom
>
>[Components]
>Name: workstation; Description: Workstation files; Types: full workstation
>Name: database; Description: Shared files; Types: full database
>
>[Tasks]
>Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Components: workstation
>Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked; Components: workstation
>
>[Files]
>;**********************************************************************
>;
>; Workstation component files
>;
>;**********************************************************************
>Source: Optical.exe; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: FoxyPreviewer.app; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: ftpservers.dbf; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: ftpservers.cdx; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: D:\Development\VFP9\VMP2005\XLib\DIBAPI32.DLL; DestDir: {app}; Components: workstation
>Source: System.app; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: Best Practice - Optical.ini; DestDir: {app}; Components: workstation; Flags: confirmoverwrite
>Source: BPOLoader.exe; DestDir: {app}; Flags: replacesameversion; Components: workstation
>Source: BestPracticeOptical.chm; DestDir: {app}; Components: workstation
>Source: GRAPHICS\Best Practice - Optical.png; DestDir: {app}; Components: workstation
>Source: D:\Development\VFP9\gdiplus.dll; DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall restartreplace; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\vfp9r.dll; DestDir: {cf}\Microsoft Shared\VFP; Flags: regserver sharedfile uninsneveruninstall restartreplace; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\vfp9renu.dll; DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall restartreplace; Components: workstation
>Source: D:\Development\VFP9\msvcr71.dll; DestDir: {sys}; Flags: uninsneveruninstall onlyifdoesntexist; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\foxhhelp9.exe; DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall restartreplace; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\foxhhelpps9.dll; DestDir: {cf}\Microsoft Shared\VFP; Flags: regserver sharedfile restartreplace uninsneveruninstall; Components: workstation
>Source: C:\Program Files (x86)\DBITech\SolPIM3\Components\ctMDay.ocx; DestDir: {app}; Flags: regserver sharedfile; Components: workstation
>Source: C:\Program Files (x86)\DBITech\SolPIM3\Components\ctDate.ocx; DestDir: {app}; Flags: regserver sharedfile; Components: workstation
>Source: C:\Program Files (x86)\DBITech\SolPIM3\Components\ctdEdit.ocx; DestDir: {app}; Flags: regserver sharedfile; Components: workstation
>Source: C:\Program Files (x86)\DBITech\ctListBar 6.0\Components\ctListBar.ocx; DestDir: {app}; Flags: regserver sharedfile; Components: workstation
>Source: vfpcompression.fll; DestDir: {app}; Components: workstation
>Source: C:\WINDOWS\SYSTEM32\richtx32.ocx; DestDir: {app}; Flags: regserver sharedfile; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\ReportBuilder.app; DestDir: {app}; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\ReportOutput.app; DestDir: {app}; Components: workstation
>Source: C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\ReportPreview.app; DestDir: {app}; Components: workstation
>
>; Visual C++ support files
>Source: D:\Development\Stonefield Query SDK\Setup Files\asycfilt.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\comcat.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\oleaut32.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist regserver noregerror; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\olepro32.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\stdole2.tlb; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist regtypelib noregerror; Components: workstation
>
>; OCX and DLLs
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSComCtl.ocx; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSComCt2.ocx; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSMAPI32.ocx; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSXML3.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSXML3R.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSXML4.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\MSXML4R.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\TaskScheduler.dll; DestDir: {cf}\Microsoft Shared\VFP; Flags: ignoreversion regserver; Components: workstation
>
>Source: mscomm32.ocx; DestDir: {sys}; Flags: regserver sharedfile uninsneveruninstall
>
>; HTML Help system files
>Source: D:\Development\Stonefield Query SDK\Setup Files\HH.EXE; DestDir: {win}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\HHCtrl.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\ITIRCL.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\ITSS.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile onlyifdoesntexist; Components: workstation
>
>; TeeChart ActiveX control
>Source: D:\Development\Stonefield Query SDK\Setup Files\TeeChart7.ocx; DestDir: {sys}; Flags: sharedfile regserver; Components: workstation
>Source: D:\Development\Stonefield Query SDK\Setup Files\lpng.dll; DestDir: {sys}; Flags: sharedfile; Components: workstation
>
>
>;**********************************************************************
>;
>; Database component files - not really a database component anymore, but some shared files
>;
>;**********************************************************************
>;Source: DATA.Install blank\*; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist recursesubdirs
>Source: Dictionary.dbf; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Dictionary.cdx; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: REPORTS\patientaddress.LBT; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: REPORTS\patientaddress.lbx; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\barcode.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\best practice - optical.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\blank.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\contactlens.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\eyechart.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\spectaclelens.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\SOLUTIONS.JPG; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\cleaners.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\frames.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\sunglasses.jpg; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\CONTACTLENS.JPG; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\SOLUTIONS.JPG; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\MAGNIFIER.JPG; DestDir: {code:GetDataDir}; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\eyes.gif; DestDir: {code:GetDataDir}\Drawings; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\fitdrawing.gif; DestDir: {code:GetDataDir}\Drawings; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\ophthalmoscopy.gif; DestDir: {code:GetDataDir}\Drawings; Components: database; Flags: onlyifdoesntexist
>Source: Graphics\toricdrawing.gif; DestDir: {code:GetDataDir}\Drawings; Components: database; Flags: onlyifdoesntexist
>Source: folder.txt; DestDir: {code:GetDataDir}\Drawings\CLTrials; Flags: ignoreversion; Components: database
>Source: folder.txt; DestDir: {code:GetDataDir}\Drawings\CLExternal; Flags: ignoreversion; Components: database
>Source: folder.txt; DestDir: {code:GetDataDir}\Drawings\External; Flags: ignoreversion; Components: database
>Source: folder.txt; DestDir: {code:GetDataDir}\Drawings\Ophthalmoscopy; Flags: ignoreversion; Components: database
>
>[Icons]
>Name: {group}\Optical; Filename: {app}\Optical.exe; WorkingDir: {app}; IconIndex: 0; Components: workstation
>Name: {commondesktop}\Best Practice - Optical; Filename: {app}\Optical.exe; Tasks: desktopicon; WorkingDir: {app}; IconIndex: 0; Components: workstation
>Name: {commonappdata}\Microsoft\Internet Explorer\Quick Launch\Best Practice - Optical; Filename: {app}\Optical.exe; Tasks: quicklaunchicon; WorkingDir: {app}; IconIndex: 0; Components: workstation
>Name: {group}\Help; Filename: {app}\BestPracticeOptical.chm; WorkingDir: {app}; Components: workstation
>
>[Run]
>Filename: {cf}\Microsoft Shared\VFP\foxhhelp9.exe; Parameters: /regserver
>Filename: {app}\Optical.exe; Description: {cm:LaunchProgram,Best Practice - Optical}; Flags: nowait postinstall skipifsilent; OnlyBelowVersion: 0,6
>
>[Registry]
>; License for MSCOMCTL.OCX classes
>Root: HKCR; Subkey: Licenses\ED4B87C4-9F76-11D1-8BF7-0000F8754DA1; ValueType: string; ValueData: knlggnmntgggrninthpgmnngrhqhnnjnslsh
>; License for MSMAPI.OCX classes
>Root: HKCR; Subkey: Licenses\899B3E80-6AC6-11cf-8ADB-00AA00C00905; ValueType: string; ValueData: wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun
>
>[INI]
>;Filename: {commonappdata}\Best Practice\Optical\Best Practice - Optical.ini; Section: Database; Key: SHAREDPATH; String: {code:GetDataDir}\PM.dbc; Components: database
>
>[Dirs]
>Name: {app}; Components: workstation; Permissions: everyone-modify
>Name: {code:GetDataDir}; Components: database; Permissions: everyone-modify
>
>[Code]
>var
> DataDirPage: TInputDirWizardPage;
>
>procedure InitializeWizard;
>begin
> { Create the data directory page }
> DataDirPage := CreateInputDirPage( wpSelectComponents,
> 'Select Data Directory', 'Where should the shared files be installed?',
> 'Setup will install the shared files into the following folder.',
> False, 'New Folder');
> DataDirPage.Add( 'To continue, click Next. If you would like to select a different location, click Browse');
>end;
>
>procedure RegisterPreviousData( PreviousDataKey: Integer);
>begin
> { Save the DataDir setting so we can restore it next time }
> SetPreviousData( PreviousDataKey, 'DataDir', DataDirPage.Values[0]);
>end;
>
>function ShouldSkipPage( PageID: Integer): Boolean;
>begin
> { Skip the DataDir page if the database component is not selected }
> if ( PageID = DataDirPage.ID) then
> Result := pos( 'database', WizardSelectedComponents( false)) = 0
>end;
>
>function NextButtonClick( CurPageID: Integer): Boolean;
>begin
> { If we're leaving the wpSelectDir page we now have the value for the 'app' variable,
> which we can use to create the default value for the DataDir variable if there is no
> value already available from a previous install. }
> if ( CurPageID = wpSelectDir) then
> begin
> { Set the value of the data directory to the value of DataDir from the previous
> install, if any. }
> DataDirPage.Values[0] := GetPreviousData( 'DataDir', '');
> { If there was no previous value then supply a default value. }
> if DataDirPage.Values[0] = '' then
> DataDirPage.Values[0] := ExpandConstant( '{app}') + '\BPO Shared';
> end;
> Result := True;
>end;
>
>function UpdateReadyMemo( Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
> MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
>var
> S: String;
>begin
> { Fill the 'Ready Memo' with the normal settings and the custom settings }
> S := '';
> S := MemoComponentsInfo + NewLine + NewLine;
>
> { Workstation component is selected }
> if pos( 'workstation', WizardSelectedComponents( false)) > 0 then
> S := S + MemoDirInfo + ' ( workstation)' + NewLine;
>
> { Database component is selected }
> if pos( 'database', WizardSelectedComponents( false)) > 0 then
> if pos( 'workstation', WizardSelectedComponents( false)) > 0 then
> { Workstation component is also selected }
> S := S + Space + DataDirPage.Values[0] + ' ( database)' + NewLine
> else begin
> { Workstation component is not selected }
> S := S + 'Destination Directory:' + NewLine;
> S := S + Space + DataDirPage.Values[0] + ' ( database)' + NewLine;
> end;
>
> Result := S;
>end;
>
>function GetDataDir( S: String): String;
>begin
> { Return the selected DataDir }
> Result := DataDirPage.Values[0];
>end;
>
>function GetAppDir( Default: String): String;
>begin
> { Return the install dir }
> Result := ExpandConstant( '{app}');
>end;
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham