|
From: <sag...@us...> - 2010-01-25 19:38:16
|
Revision: 478
http://modplug.svn.sourceforge.net/modplug/?rev=478&view=rev
Author: saga-games
Date: 2010-01-25 19:38:07 +0000 (Mon, 25 Jan 2010)
Log Message:
-----------
[Fix] Installer: The VST plugin scanner apparently broke the "Exit Setup" string. Furthermore, it wrote a wrong key in the mptrack.ini file.
Modified Paths:
--------------
trunk/OpenMPT/installer/vst_scan.iss
Modified: trunk/OpenMPT/installer/vst_scan.iss
===================================================================
--- trunk/OpenMPT/installer/vst_scan.iss 2010-01-25 19:22:19 UTC (rev 477)
+++ trunk/OpenMPT/installer/vst_scan.iss 2010-01-25 19:38:07 UTC (rev 478)
@@ -7,86 +7,73 @@
[Code]
var
- ProgressPage: TOutputProgressWizardPage;
- ProgressValue: Integer;
- ArrayLen: LongInt;
- bExitSetup: Boolean;
- INIFile: String;
- VSTPluginNumber: Integer;
+ ProgressPage: TOutputProgressWizardPage;
+ ProgressValue: Integer;
+ ArrayLen: LongInt;
+ bExitSetup: Boolean;
+ INIFile: String;
+ VSTPluginNumber: Integer;
procedure ProcessDirectory (RootDir: String; Progress: Boolean);
var
- NewRoot: String;
- FilePath: String;
- FindRec: TFindRec;
+ NewRoot: String;
+ FilePath: String;
+ FindRec: TFindRec;
begin
- if bExitSetup then
- Exit;
- NewRoot := AddBackSlash (RootDir);
- if FindFirst (NewRoot + '*', FindRec) then
- begin
- try
- repeat
- if (FindRec.Name <> '.') AND (FindRec.Name <> '..') then
- begin
- FilePath := NewRoot + FindRec.Name;
- if FindRec.Attributes AND FILE_ATTRIBUTE_DIRECTORY > 0 then
- ProcessDirectory (FilePath, Progress)
- else
- begin
- // Start action -->
- // .
- // Add your custom code here.
- // FilePath contains the file name
- // including its full path name.
- // Try not to call a function for every file
- // as this could take a very long time.
- // .
- // <-- End action.
- SetIniString('VST Plugins', 'Plugin' + IntToStr(VSTPluginNumber), FilePath, INIFile);
- VSTPluginNumber := VSTPluginNumber +1;
-
- ArrayLen := ArrayLen + 1;
- if (Progress) then
- begin
- if (ArrayLen mod 1000) = (ArrayLen / 1000) then
- begin
- ProgressValue := ProgressValue + 1;
- if ProgressValue = 100 then
- ProgressValue := 0;
- ProgressPage.SetProgress (ProgressValue, 100);
- end;
- end;
- end;
- end;
- if (bExitSetup) then
- Exit;
- until NOT FindNext (FindRec);
- finally
- FindClose(FindRec);
- end;
- end;
+ if bExitSetup then
+ Exit;
+ NewRoot := AddBackSlash (RootDir);
+ if FindFirst (NewRoot + '*', FindRec) then
+ begin
+ try
+ repeat
+ if (FindRec.Name <> '.') AND (FindRec.Name <> '..') then
+ begin
+ FilePath := NewRoot + FindRec.Name;
+ if FindRec.Attributes AND FILE_ATTRIBUTE_DIRECTORY > 0 then
+ ProcessDirectory (FilePath, Progress)
+ else
+ begin
+ // Start action -->
+ // .
+ // Add your custom code here.
+ // FilePath contains the file name
+ // including its full path name.
+ // Try not to call a function for every file
+ // as this could take a very long time.
+ // .
+ SetIniString('VST Plugins', 'Plugin' + IntToStr(VSTPluginNumber), FilePath, INIFile);
+ VSTPluginNumber := VSTPluginNumber +1;
+ // <-- End action.
+
+ ArrayLen := ArrayLen + 1;
+ if (Progress) then
+ begin
+ if (ArrayLen mod 1000) = (ArrayLen / 1000) then
+ begin
+ ProgressValue := ProgressValue + 1;
+ if ProgressValue = 100 then
+ ProgressValue := 0;
+ ProgressPage.SetProgress (ProgressValue, 100);
+ end;
+ end;
+ end;
+ end;
+ if (bExitSetup) then
+ Exit;
+ until NOT FindNext (FindRec);
+ finally
+ FindClose(FindRec);
+ end;
+ end;
end;
-function MessageBox (hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer;
- external 'Mes...@us... stdcall';
-
-procedure CancelButtonClick (CurPageID: Integer; var Cancel, Confirm: Boolean);
-begin
- Confirm := FALSE;
- if (MessageBox (0, SetupMessage (msgExitSetupMessage),
- SetupMessage (msgExitSetupTitle), 4 + 32) = 6) then
- begin
- bExitSetup := TRUE;
- end;
-end;
-
procedure CurStepChanged (CurStep: TSetupStep);
var
- Dir: String;
+ Dir: String;
begin
- if ((CurStep = ssInstall) And (IsTaskSelected('vst_scan'))) then
- begin
+ if ((CurStep = ssInstall) And (IsTaskSelected('vst_scan'))) then
+ begin
// Get the right INI path.
if(IsTaskSelected('portable')) then
@@ -96,29 +83,29 @@
begin
INIFile := ExpandConstant('{userappdata}\OpenMPT\mptrack.ini');
end;
- VSTPluginNumber := GetIniInt('VST Plugins', 'NumPlugin', 0, 0, 0, INIFile);
+ VSTPluginNumber := GetIniInt('VST Plugins', 'NumPlugins', 0, 0, 0, INIFile);
- // The folder to scan.
+ // The folder to scan.
Dir := ExpandConstant('{pf}\Steinberg\VstPlugins');
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\VST', 'VSTPluginsPath', Dir); // won't touch Dir if registry path does not exist
- // The progress page.
- ProgressPage := CreateOutputProgressPage (CustomMessage ('ProgressTitle'),
- CustomMessage ('ProgressCaption'));
- ProgressPage.SetText (CustomMessage ('ProgressText'), Dir);
- ProgressPage.SetProgress(0, 0);
- ProgressPage.Show;
- // Make the Cancel button visible during the operation.
- ;WizardForm.CancelButton.Visible := TRUE;
- // Scan the folder.
- ProcessDirectory (Dir, TRUE);
- // Hide the progress page.
- try
- finally
- ProgressPage.Hide;
- end;
+ // The progress page.
+ ProgressPage := CreateOutputProgressPage (CustomMessage ('ProgressTitle'),
+ CustomMessage ('ProgressCaption'));
+ ProgressPage.SetText (CustomMessage ('ProgressText'), Dir);
+ ProgressPage.SetProgress(0, 0);
+ ProgressPage.Show;
+ // Make the Cancel button visible during the operation.
+ ;WizardForm.CancelButton.Visible := TRUE;
+ // Scan the folder.
+ ProcessDirectory (Dir, TRUE);
+ // Hide the progress page.
+ try
+ finally
+ ProgressPage.Hide;
+ end;
// Update INI key
- SetIniInt('VST Plugins', 'NumPlugin', VSTPluginNumber, INIFile);
+ SetIniInt('VST Plugins', 'NumPlugins', VSTPluginNumber, INIFile);
end;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|