Guest User

Untitled

a guest
Apr 4th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. [Code]
  2. var
  3. Page0: TInputQueryWizardPage;
  4. Page1: TInputDirWizardPage;
  5.  
  6. // Launch DB CLIP installation
  7. procedure ButtonOnClick(Sender: TObject);
  8. var
  9. Params: string;
  10. ScriptPath: string;
  11. ResultCode: Integer;
  12. DBPath: string;
  13. Server: String;
  14. Instance: String;
  15. SQL_User: String;
  16. SQL_Password: String;
  17.  
  18. begin
  19. DBPath := Page1.Values[0];
  20. Server:= Page0.Values[0];
  21. Instance:= Page0.Values[1];
  22. SQL_User:= Page0.Values[2];
  23. SQL_Password:= Page0.Values[3];
  24. ScriptPath := ExpandConstant('"{app}DBCreate Database 2.12.3.sql"');
  25. Params := '-v CLIPDATA="'+DBPath+'" CLIPINDEX="'+DBPath+'" CLIPLOG="'+DBPath+'" -S '+Server+''+Instance+' -U '+SQL_User+' -P '+SQL_Password+' -i '+ScriptPath ;
  26.  
  27. if MsgBox('' + Params + '', mbInformation, mb_YesNo) = idYes then
  28. Exec ('sqlcmd',Params, '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
  29. Exit;
  30. end;
  31.  
  32. procedure InitializeWizard();
  33.  
  34. var
  35.  
  36. DBButton: TNewButton;
  37.  
  38. begin
  39.  
  40. Page0 := CreateInputQueryPage(wpInfoAfter,
  41. 'SQL Informations', '',
  42. 'Please specify Server and Instance name , then click Next.');
  43.  
  44. Page0.Add('Server:', False);
  45. Page0.Add('Instance:', False);
  46. Page0.Add('SQL User:', False);
  47. Page0.Add('SQL Password:', True);
  48. Page0.Values[0] := ('localhost');
  49. Page0.Values[1] := ('CLIP');
  50. Page0.Values[2] := ('sa');
  51. Page0.Values[3] := ('clip');
  52.  
  53. Page1 := CreateInputDirPage(Page0.ID,
  54. 'Select CLIP Database files Location', '',
  55. 'CLIP DB data files will be stored in the following folder.'#13#10#13#10 +
  56. 'To continue, click Next. ' +
  57. 'If you would like to select a different folder, click Browse.',
  58. False, 'New Folder');
  59.  
  60. Page1.Add('Database Folder');
  61. Page1.Values[0] := ExpandConstant('{pf}CLIPCLIP_DATADB');
  62.  
  63. DBButton := TNewButton.Create(Page1);
  64. DBButton.Left := ScaleX(16);
  65. DBButton.Top := ScaleY(205);
  66. DBButton.Width := ScaleX(100);
  67. DBButton.Height := ScaleY(25);
  68. DBButton.Caption := 'Install DB CLIP';
  69. DBButton.OnClick := @ButtonOnClick;
  70. DBButton.Parent := Page1.Surface;
  71.  
  72. end;
Add Comment
Please, Sign In to add comment