Advertisement
deejay007

Inno_Sample

Mar 13th, 2015
2,680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [Setup]
  2. #define MyAppName "XXX_XXX"
  3. #define MyAppVerName "XXXX Setup 9.2.0"
  4.  
  5. [Code]
  6. var
  7. PageSQLSetupFile: TInputFileWizardPage;
  8.  
  9. function MSSQLSETUPDIR_CreatePage(PreviousPageId: Integer): Integer;
  10. var
  11.   Page: TWizardPage;
  12.   BMPFile: String;
  13. begin
  14.   SelectedSQLServerVersion := GetSQLServerVersion('');
  15.   Page := CreateCustomPage(
  16.     PreviousPageId,
  17.     ExpandConstant('Database Settings'),
  18.     ExpandConstant('Special note for the Microsoft ' + SelectedSQLServerVersion + ' Setup')
  19.   );
  20.  
  21.     BMPFile:= ExpandConstant('{tmp}\caution.bmp');
  22.     if not FileExists(BMPFile) then ExtractTemporaryFile(ExtractFileName(BMPFile));
  23. { BitmapImage1 }
  24.   BitmapImage1 := TBitmapImage.Create(Page);
  25.   with BitmapImage1 do
  26.   begin
  27.     Bitmap.LoadFromFile(BMPFile);
  28.     Parent := Page.Surface;
  29.     Left := ScaleX(8);
  30.     Top := ScaleY(8);
  31.     Width := ScaleX(97);
  32.     Height := ScaleY(209);
  33.   end;
  34.   { NewStaticText1 }
  35.   NewStaticText1 := TNewStaticText.Create(Page);
  36.   with NewStaticText1 do
  37.   begin
  38.     Parent := Page.Surface;
  39.     //Caption := 'To install Microsoft SQL Server 2008 you have to insert the Microsoft SQL Server 2008 Setup CD, when EcoEMOS setup requests it. The installation path of your Microsoft SQL Server 2008 setup and the additional Service Packs can be defined on the next pages.';
  40.     Caption := 'To install Microsoft ' + SelectedSQLServerVersion + ' you have to insert the Microsoft SQL Server 2008 Setup CD, when EcoEMOS setup requests it. The installation path of your Microsoft SQL Server 2008 setup and the additional Service Packs can be defined on the next pages.';
  41.     Log('Server is... ' + SelectedSQLServerVersion);
  42.     Log('Caption is... ' + Caption);
  43.     Left := ScaleX(112);
  44.     Top := ScaleY(8);
  45.     Width := ScaleX(292);
  46.     Height := ScaleY(77);
  47.     AutoSize := False;
  48.     TabOrder := 0;
  49.     WordWrap := True;
  50.   end;
  51.  
  52.   { NewStaticText2 }
  53.   NewStaticText2 := TNewStaticText.Create(Page);
  54.   with NewStaticText2 do
  55.   begin
  56.     Parent := Page.Surface;
  57.     Caption :=
  58.       'CAUTION: When autorun is activated, dont click in the autorun menu of Microsoft SQL Server 2008.' + #13 +
  59.       'Otherwise you must reboot your machine and restart the setup !';
  60.     Left := ScaleX(112);
  61.     Top := ScaleY(88);
  62.     Width := ScaleX(293);
  63.     Height := ScaleY(62);
  64.     AutoSize := False;
  65.     Font.Color := -16777208;
  66.     Font.Height := ScaleY(-11);
  67.     Font.Name := 'Tahoma';
  68.     Font.Style := [fsBold];
  69.     ParentFont := False;
  70.     TabOrder := 1;
  71.     WordWrap := True;
  72.   end;
  73.  
  74.   with Page do
  75.   begin
  76.     OnActivate := @MSSQLSETUPDIR_Activate;
  77.     OnShouldSkipPage := @MSSQLSETUPDIR_ShouldSkipPage;
  78.     OnBackButtonClick := @MSSQLSETUPDIR_BackButtonClick;
  79.     OnNextButtonClick := @MSSQLSETUPDIR_NextButtonClick;
  80.     OnCancelButtonClick := @MSSQLSETUPDIR_CancelButtonClick;
  81.   end;
  82.  
  83.   Result := Page.ID;
  84. end;
  85.  
  86. procedure InitializeWizard();
  87. begin
  88.     MyModeTypical := false;
  89.  
  90.     // Product Name
  91.     PageProductName := CreateInputQueryPage(wpSelectComponents,
  92.         'Settings',
  93.         'Product Name',
  94.         'Please specify the product name, then click Next.');
  95.     // Add items (False means it's not a password edit)
  96.     PageProductName.Add('Product Name:', False);
  97.     PageProductName.Values[0] := ProductName;
  98.  
  99.     // Dialog with special Caution Message for SQl Server Setup
  100.     // see NewStaticText1 und NewStaticText2
  101.     PageSQLSetupFile2 := MSSQLSETUPDIR_CreatePage(PageProductName.ID);
  102.  
  103.     // SQL Server Setup - Enter path to Setup CD
  104.     PageSQLSetupFile := CreateInputFilePage(PageSQLSetupFile2,
  105.         'Database Settings',
  106.         'Caption',
  107.         'Description');
  108.     // Add item
  109.     if IsWin64 then begin
  110.         PageSQLSetupFile.Add('Location of the Microsoft SQL Server 2008 (64-bit) Setup:',
  111.             'Microsoft SQL Server 2008 Setup file (SETUP.EXE)|SETUP.EXE|All files|*.*',
  112.             'SETUP.EXE');
  113.     end else begin
  114.         PageSQLSetupFile.Add('Location of the Microsoft SQL Server 2008 (x86) Setup:',
  115.             'Microsoft SQL Server 2008 Setup file (SETUP.EXE)|SETUP.EXE|All files|*.*',
  116.             'SETUP.EXE');
  117.     end;
  118.     PageSQLSetupFile.Values[0] := SQLServerSetupFile;
  119.  
  120. end;
  121.  
  122. procedure CurPageChanged(CurPageID: Integer);
  123. begin
  124.     if CurPageID = PageDBServer.ID then begin
  125.         // Check if Component DAS is selected and if yes, set local computer name as DB Server name
  126.         if IsComponentSelected('DBS') then begin
  127.             PageDBServer.Values[0] := MyComputerName;
  128.         end else begin
  129.             PageDBServer.Values[0] := MyDBServer;
  130.         end;
  131.     end else if CurPageID = PageNameservice.ID then begin
  132.         // Check if Component WAS is selected and if yes, set local computer name as nameserver name
  133.         if IsComponentSelected('WAS') then begin
  134.             PageNameservice.Values[0] := MyComputerName;
  135.         end else begin
  136.             PageNameservice.Values[0] := Nameservice;
  137.         end;
  138.     end else if CurPageID = PageSQLSetupFile.ID then begin
  139.          //Check if Component WAS is selected and if yes, set local computer name as nameserver name
  140.         if SelectedSQLServerVersion <> '' then begin
  141.             PageSQLSetupFile.Caption := 'Location of the Microsoft ' + SelectedSQLServerVersion + ' Setup ?';
  142.         end else begin
  143.             PageSQLSetupFile.Description := 'Enter the Microsoft ' + SelectedSQLServerVersion + ' setup path, then click Next.';
  144.         end;   
  145.     end;
  146. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement