This question already has answers here:
Inno Setup generated installer does not show "Select Destination Location" page on some systems
(3 answers)
Closed 4 years ago.
On first install everything runs smooth, but if I run the installer again it just jumps to the second page asking where i want to put the additional files, and then in the ready page only the parameters for the additional files folders is shown. The ignore version flag is set, what else could it be?
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
Compression=lzma
SolidCompression=yes
OutputBaseFilename=aeolian_meditation_setup
WizardSmallImageFile=compiler:greenlogo.bmp
WizardImageFile=compiler:glogo.bmp
DirExistsWarning=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
;Main program that will be installed in {app} folder
Source: "D:\ocean_swift\Flowstone Projects\Aeolian Meditation Advanced\OS Aeolian Meditation Advanced A191.exe"; DestDir: "{app}"; Flags: ignoreversion
;Database file that will installed where user choosed
Source: "D:\ocean_swift\Flowstone Projects\Aeolian Meditation Advanced\onts\OpenSans-Regular.ttf"; DestDir: "{fonts}"; Flags: onlyifdoesntexist; FontInstall: "Open Sans"
Source: "C:\Program Files (x86)\VSTPlugins\OS Aeolian Meditation Advanced A191.dll"; DestDir: "{code:GetDataDir}"
[Code]
var
DataDirPage: TInputDirWizardPage;
procedure InitializeWizard;
begin
// Create the page
DataDirPage := CreateInputDirPage(wpSelectDir,
'Select 32bit VST Plugin Directory', 'Where should the 32bit VSTi plugin be installed??',
'Select the folder in which Setup should install the 32bit VSTi plugin, then click Next.',
False, '');
DataDirPage.Add('');
DataDirPage.Values[0] := 'C:\Program Files (x86)\VSTPlugins\';
end;
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
// Store the selected folder for further reinstall/upgrade
SetPreviousData(PreviousDataKey, 'DataDir', DataDirPage.Values[0]);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
// Set default folder if empty
if DataDirPage.Values[0] = '' then
DataDirPage.Values[0] := ExpandConstant('{sd}\DataDir');
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 := S + MemoDirInfo + NewLine + NewLine;
S := S + '32bit VSTi' + NewLine;
S := S + Space + DataDirPage.Values[0] + NewLine;
Result := S;
end;
function GetDataDir(Param: String): String;
begin
{ Return the selected DataDir }
Result := DataDirPage.Values[0];
end;
If you look here you will see that the default value for DisableProgramGroupPage is auto. As described there:
If this is set to auto, at startup Setup will look in the registry to
see if the same application is already installed, and if so, it will
not show the Select Start Menu Folder wizard page.
If you review the other Disable entries in the help file you will see them behave the same. It is logical to only show these pages during a new install. Change the default behaviour by setting these to no.
Related
I am newbie with Inno Setup and I have been reading some threads but could not find how to do the following.
I simply would like to search for folders within a directory and in each folder detected install the same file with no selection of wizard page shown to the user. Not recursive, only files inside the detected folders and not subfolders.
I meant to install the same file in all folders detected while giving no option to the user to choose from. However, all other pages in the installer would be displayed as usual.
Thanks in advance
Tag the file with dontcopy flag and then install it programmatically in CurStepChanged(ssInstall) (or ssPostInstall).
Use ExtractTemporaryFile to extract the file to a temporary folder.
Use FindFirst/FindNext functions to find the subfolders.
Use FileCopy to copy the file from a temporary folder to the found subfolder(s).
Log a lot.
This will work well, only if the file is not huge. Otherwise the installer will unpleasantly hang. For a good user experience with huge files, more complex solution is needed.
#define TheFileName "thefile.txt"
[Files]
Source: "{#TheFileName}"; Flags: dontcopy
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
RootPath: string;
TempPath: string;
DestPath: string;
FindRec: TFindRec;
Count: Integer;
begin
if CurStep = ssInstall then
begin
Log('Extracting {#TheFileName}...');
ExtractTemporaryFile('{#TheFileName}');
TempPath := ExpandConstant('{tmp}\{#TheFileName}');
RootPath := ExpandConstant('{app}');
Log(Format('Searching in "%s"...', [RootPath]));
Count := 0;
if not FindFirst(RootPath + '\*', FindRec) then
begin
Log(Format('"%s" not found.', [RootPath]));
end
else
begin
try
repeat
if (FindRec.Name <> '.') and (FindRec.Name <> '..') and
(FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0) then
begin
Log(Format('Found "%s".', [FindRec.Name]));
DestPath := RootPath + '\' + FindRec.Name + '\{#TheFileName}';
if FileCopy(TempPath, DestPath, False) then
begin
Log(Format('The file was installed to "%s".', [DestPath]));
Inc(Count);
end
else
begin
Log(Format('Error installing the file to "%s".', [DestPath]));
end;
end;
until not FindNext(FindRec);
finally
FindClose(FindRec);
end;
if Count = 0 then
begin
Log(Format('No subfolder to install file "%s" to was found in "%s".', [
'{#TheFileName}', RootPath]));
end
else
begin
Log(Format('File "%s" was installed to %d subfolder(s) of "%s".', [
'{#TheFileName}', Count, RootPath]));
end;
end;
end;
end;
Alternatively, if you have a fixed set of folders, you can generate entry for each folder in the [Files] section using preprocessor:
[Files]
#define FolderEntry(Name) \
"Source: ""C:\source\*""; DestDir: ""{app}\" + Name + """; " + \
"Check: CheckDir('" + Name + "')"
#emit FolderEntry('2023')
#emit FolderEntry('2024')
#emit FolderEntry('2025')
[Code]
function CheckDir(DirName: string): Boolean;
begin
Result := DirExists(ExpandConstant('{app}') + '\' + DirName);
end;
If you add SaveToFile to the end of the script:
#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed.iss")
... then you should see in Preprocessed.iss that the code generates a script like this:
[Files]
Source: "C:\source\*"; DestDir: "{app}\2023"; Check: CheckDir('2023')
Source: "C:\source\*"; DestDir: "{app}\2024"; Check: CheckDir('2024')
Source: "C:\source\*"; DestDir: "{app}\2025"; Check: CheckDir('2025')
Thanks a lot Martin! I did it another way that may be of help to other users.
I set a file for every potential folder I want to detect (it was only for four).
[Files] Source: "C:\Users\XXXXX\dll\*"; DestDir: "{commonappdata}\XXXX\2023"; Check:CheckDir2023;
Then I use the following to check if the folder exists:
function CheckDir2023 : Boolean;
begin
if (DirExists(ExpandConstant('{commonappdata}\xxxxxx\2023\'))) then
begin
Result := True;
end
else
begin
Result := False;
end;
end;
In Inno Setup I try to create this shortcut:
"C:\Program Files (x86)\MapInfo\Professional\MapInfow.exe" "{app}\DPImap.MBX"
It works fine with static text, however location of MapInfow.exe can vary so I like to ask the user for it.
This is what I did so far, however the shortcut is not created as intended
; Default value for silent installion
#define MapInfoDefault AddBackslash(GetEnv("ProgramFiles(x86)")) + "MapInfo\Professional\MapInfow.exe"
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Icons]
Name: {group}\DPImap; Filename: {code:MapInfoExecutable} {app}\DPImap.mbx
Name: {userdesktop}\DPImap; Filename: {code:MapInfoExecutable} {app}\DPImap.mbx; Tasks: desktopicon
[Code]
function MapInfoExecutable(Param: String): String;
var
FileName: string;
begin
FileName := '';
if GetOpenFileName('Locate your MapInfo Application', FileName, ExpandConstant('{pf32}'), 'Executable (*.exe)|*.exe', 'exe') then
Result := FileName
else
{ Return default #MapInfoDefault if user does not provide any file }
Result := ExpandConstant('{#MapInfoDefault}');
end;
How can I provide proper user dialog?
It should be:
[Icons]
Name: {group}\DPImap; Filename: "{code:MapInfoExecutable}"; \
Parameters: """{app}\DPImap.mbx"""
You should also cache the selected file name, otherwise you get the prompt at least twice, and probably even more times.
var
FileName: string;
function MapInfoExecutable(Param: String): String;
begin
if FileName = '' then
begin
if not GetOpenFileName(
'Locate your MapInfo Application', FileName, ExpandConstant('{pf32}'),
'Executable (*.exe)|*.exe', 'exe') then
begin
{ Return default #MapInfoDefault if user does not provide any file }
FileName := '{#MapInfoDefault}';
end;
end;
Result := FileName;
end;
Or actually even better, use a custom page, rather than a dialog, which pops up at uncontrollable moment.
See Inno Setup Prompt for external file location.
And even if you like the dialog, pop it on specific page/moment of your choice, cache the selected file name to a global variable and use the variable in the MapInfoExecutable.
Note that I've removed ExpandConstant from '{#MapInfoDefault}' - It's nonsense. See Evaluate preprocessor macro on run time in Inno Setup Pascal Script.
Hello i am trying to make an installer using INNO SETUP, when i started to use ISSkin Code Inno setup send me an error mesage DUPLICATE IDENTIFIER 'INITIALIZESETUP' I would like to know what i have to change to my code to make it work.
I was reading at internet and i found a program called IS Script Joiner, i used it but it doesnt work.
Here is my Inno Code:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Myprogram"
#define MyAppVersion "2.8"
#define MyAppPublisher "Myprogram"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "program.exe"
#define ISSI_WizardSmallBitmapImage "wpBanner.bmp"
#define ISSI_WizardSmallBitmapImage_x 495
#define ISSI_WizardSmallBitmapImage_Align
#define ISSI_IncludePath "C:\ISSI"
#include ISSI_IncludePath+"\_issi.isi"
[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={{2A8CE1DB-2FDB-4CAA-8A2C-0FE3DB8A500D}
AppName=Myprogram
AppVersion=2.8
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher=Myprogram
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Myprogram
DefaultGroupName={#MyAppName}
LicenseFile=C:\Libraries\EULA.rtf
OutputDir=C:\Users\Hans Lopez\INNO SETUPS
OutputBaseFilename=programoutput
SetupIconFile=C:\Libraries\Icon.ico
Compression=lzma/Max
SolidCompression=true
WizardImageFile=C:\InstallMlockPackage\Setupbanner.bmp
AppVerName=2.8
DirExistsWarning=yes
VersionInfoProductName=Myprogram
VersionInfoProductVersion=2.8
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
[Dirs]
Name: "{app}" ; Permissions: everyone-full
Name: {sd}\myprogramfolder; Permissions: everyone-full;
[Code]
//===================================================================Verify if Installed===============================================================================
function GetUninstallString: string;
var
sUnInstPath: string;
sUnInstallString: String;
begin
Result := '';
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
function IsUpgrade: Boolean;
begin
Result := (GetUninstallString() <> '');
end;
function InitializeSetup: Boolean;
var
V: Integer;
iResultCode: Integer;
sUnInstallString: string;
begin
Result := True; // in case when no previous version is found
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\ {2A8CE1DB-2FDB-4CAA-8A2C-0FE2DB8A500D}_is1', 'UninstallString') then //Your App GUID/ID
begin
V := MsgBox(ExpandConstant('Myprogram is Already installed, Do you want to continue?'), mbInformation, MB_YESNO); //Custom Message if App installed
if V = IDYES then
begin
sUnInstallString := GetUninstallString();
sUnInstallString := RemoveQuotes(sUnInstallString);
Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);
Result := True; //if you want to proceed after uninstall
//Exit; //if you want to quit after uninstall
end
else
Result := False; //when older version present and not uninstalled
end;
end;
//====================================================================Unistall and Delete Everything==================================================================
procedure DeleteBitmaps(ADirName: string);
var
FindRec: TFindRec;
begin
if FindFirst(ADirName + '\*.*', FindRec) then begin
try
repeat
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then begin
if (FindRec.Name <> '.') and (FindRec.Name <> '..') then begin
DeleteBitmaps(ADirName + '\' + FindRec.Name);
RemoveDir(ADirName + '\' + FindRec.Name);
end;
end else if Pos('.bmp', AnsiLowerCase(FindRec.Name)) > 0 then
DeleteFile(ADirName + '\' + FindRec.Name);
until not FindNext(FindRec);
finally
FindClose(FindRec);
end;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then begin
if MsgBox('Do you want to delete all data files?', mbConfirmation,
MB_YESNO) = IDYES
then begin
DeleteBitmaps(ExpandConstant('{app}'));
end;
end;
end;
//===========================================================ISSKinCODE=============================================================================
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin#files:isskin.dll stdcall';
// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin#files:isskin.dll stdcall';
// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow#user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('iTunesB.msstyles');
LoadSkin(ExpandConstant('{tmp}\iTunesB.msstyles'), '');
Result := True;
end;
procedure DeinitializeSetup();
begin
// Hide Window before unloading skin so user does not get
// a glimpse of an unskinned window before it is closed.
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;
/////////////////////////////////////////////////////////////ENDCODE/////////////////////////////////////////////////////////////////////////////////////////////////
[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
[Files]
Source: "C:\My program\program.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files\C:\My program\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\programfolder\*"; DestDir: "{sd}\Myprogramfolder"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
Source: "C:\InstallMlockPackage\ISSkin\iTunesB\iTunesB\iTunesB.msstyles"; DestDir: " {tmp}"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: " {app}\icon.ico" ;
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"; IconFilename: "{app}\icon.ico" ;
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\icon.ico" ;
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\icon.ico" ;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; IconFilename: "{app}\icon.ico" ;
Name: {group}\Uninstall =ISSkin; Filename: {app}\unins000.exe
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram, {#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Thank You very Much for Your Help
Relocate the two calls to the ISSkin DLL from where they are now (above the second InitializeSetup) to just above the first InitializeSetup declaration.
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin#files:isskin.dll stdcall';
// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin#files:isskin.dll stdcall';
Change the first InitializeSetup code to include the calls to extract and load the skin (from the second InitializeSetup).
function InitializeSetup: Boolean;
var
V: Integer;
iResultCode: Integer;
sUnInstallString: string;
begin
// These two lines moved from second InitializeSetup declaration before it
// was removed.
ExtractTemporaryFile('iTunesB.msstyles');
LoadSkin(ExpandConstant('{tmp}\iTunesB.msstyles'), '');
Result := True; // in case when no previous version is found
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\ {2A8CE1DB-2FDB-4CAA-8A2C-0FE2DB8A500D}_is1', 'UninstallString') then //Your App GUID/ID
begin
V := MsgBox(ExpandConstant('Myprogram is Already installed, Do you want to continue?'), mbInformation, MB_YESNO); //Custom Message if App installed
if V = IDYES then
begin
sUnInstallString := GetUninstallString();
sUnInstallString := RemoveQuotes(sUnInstallString);
Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);
Result := True; //if you want to proceed after uninstall
//Exit; //if you want to quit after uninstall
end
else
Result := False; //when older version present and not uninstalled
end;
end;
Remove the second InitializeSetup code entirely.
I'm preparing an inno setup to install a windows forms application and an office add-in both at the same time.
I deploy all my windows forms files (exe and dll) and the office add-in deployment files during installation and all works fine.
But at the end, I got the "installation finished" screen while the office addin "setup.exe" is still running. I don't care about seeing the other installed running or popup in the background, but I don't like the inno setup says "finished" while the other application is running.
This is my code:
[Run]
Filename: "{app}\AddIn\Deploy\setup.exe"; Flags: waituntilterminated runminimized
Filename: "{app}\MyApp.exe"; Description: {cm:LaunchProgram,{cm:MyAppName}}; Flags: nowait postinstall
So, it doesn't obey "runminimized", which I'm fine anyway.... but it doesn't obey "waituntilterminated" either, which I do care.
Note that "AddIn\Deploy\setup.exe" is the file generated by Visual Studio by the "Publish" wizard of the office add-in.
I'd be happy if I only could run this code:
[code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode : Integer;
begin
if Exec(ExpandConstant('{app}\AddIn\Deploy\setup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
Result := 'AddIn Installed';
end
else
Result := 'AddIn NOT Installed';
NeedsRestart := false;
end;
But, I would have to running right after the main inno installer copied the files to the "AddIn\Deploy" directory...
So, I might just need the right event to override.
The code you submitted could be enhanced to:
[code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode : Integer;
begin
// Your original line:
// if Exec(ExpandConstant('{app}\AddIn\Deploy\setup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
if Exec(AddQuotes(ExpandConstant('{app}\AddIn\Deploy\setup.exe')), AddQuotes(ExpandConstant('{app}\AddIn\Deploy\')), '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
Result := 'AddIn Installed';
end
else
begin // <==
Result := 'AddIn NOT Installed';
end; // <==
NeedsRestart := false;
end;
The {app} may contain spaces and the function AddQuotes does create Quotes around a string if the string contains spaces
The exec function, in my opinion, acts like a shortcut, so give the application a workingdir. Because I do not know the nature of your Setup.exe, I gave this application as workingdir the same folder as where the application resides.
A bit off-topic note:
Use SW_Hide in the final version.
The result if the application has installed the addin can always be seen if other modes are chosen other than SW_HIDE :)
I use the Inno Setup to create installer for my program. In my program I use third-party libraries, so I have to show license information for each of them.
also I want the installer to show certain license files to chosen language.
I know how to switch between license files if I have 1 license form.
I've looked in google for whole day but didn't find anything
how can I show several licenses?
You can make each license file match the language file by removing the LicenseFile directive from [Setup] and putting it in the [Languages] like this:
Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "English License.rtf"
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"; LicenseFile: "Chinese SIM License.rtf"
Name: "chinesetrad"; MessagesFile: "compiler:Languages\ChineseTrad.isl"; LicenseFile: "Chinese TRA License.rtf"
etc...
Hope that helps
You can use the CreateOutputMsgMemoPage to create a page with the memo box on. You can then adjust the sizing and add the agree/disagree boxes.
; Shows a new license page for the LGPL with the usual accept/don't acccept options
[Code]
var
LGPLPage: TOutputMsgMemoWizardPage;
LGPLAccept: TNewRadioButton;
LGPLRefuse: TNewRadioButton;
procedure LGPLPageActivate(Sender: TWizardPage); forward;
procedure LGPLAcceptClick(Sender: TObject); forward;
procedure LGPL_InitializeWizard();
var
LGPLText: AnsiString;
begin
// Create the page
LGPLPage := CreateOutputMsgMemoPage(wpLicense, SetupMessage(msgWizardLicense), SetupMessage(msgLicenseLabel), CustomMessage('LGPLHeader'), '');
// Adjust the memo and add the confirm/refuse options
LGPLPage.RichEditViewer.Height := ScaleY(148);
LGPLAccept := TNewRadioButton.Create(LGPLPage);
LGPLAccept.Left := LGPLPage.RichEditViewer.Left;
LGPLAccept.Top := LGPLPage.Surface.ClientHeight - ScaleY(41);
LGPLAccept.Width := LGPLPage.RichEditViewer.Width;
LGPLAccept.Parent := LGPLPage.Surface;
LGPLAccept.Caption := SetupMessage(msgLicenseAccepted);
LGPLRefuse := TNewRadioButton.Create(LGPLPage);
LGPLRefuse.Left := LGPLPage.RichEditViewer.Left;
LGPLRefuse.Top := LGPLPage.Surface.ClientHeight - ScaleY(21);
LGPLRefuse.Width := LGPLPage.RichEditViewer.Width;
LGPLRefuse.Parent := LGPLPage.Surface;
LGPLRefuse.Caption := SetupMessage(msgLicenseNotAccepted);
// Set the states and event handlers
LGPLPage.OnActivate := #LGPLPageActivate;
LGPLAccept.OnClick := #LGPLAcceptClick;
LGPLRefuse.OnClick := #LGPLAcceptClick;
LGPLRefuse.Checked := true;
// Load the LGPL text into the new page
ExtractTemporaryFile('lgpl-3.0.txt');
LoadStringFromFile(ExpandConstant('{tmp}/lgpl-3.0.txt'), LGPLText);
LGPLPage.RichEditViewer.RTFText := LGPLText;
end;
procedure LGPLPageActivate(Sender: TWizardPage);
begin
WizardForm.NextButton.Enabled := LGPLAccept.Checked;
end;
procedure LGPLAcceptClick(Sender: TObject);
begin
WizardForm.NextButton.Enabled := LGPLAccept.Checked;
end;
[Files]
Source: {#Common}Setups\lgpl-3.0.txt; DestDir: {app}; Flags: ignoreversion
[CustomMessages]
LGPLHeader=Please read the following License Agreement. Some components are licensed under the GNU Lesser General Public License.