Ver Mensaje Individual
  #7  
Antiguo 08-03-2005
Avatar de alt126
alt126 alt126 is offline
Miembro
 
Registrado: dic 2004
Posts: 171
Reputación: 22
alt126 Va por buen camino
Ahi te dejo un codigo de ejemplo...

Es para el inno setup...lo debes de copiar tal como esta y miras lo que hace. Simplemente te muestra una pantallita con el arbol de directorios del disco duro, para que el usuario seleccione el directorio donde esta la BD. Si necesitas algo mas....PIDELO!!

Adios,

Antonio


; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=prueba
AppVerName=prueba
DefaultDirName={pf}\prueba
DisableDirPage=yes
DefaultGroupName=p\rueba
DisableProgramGroupPage=yes
[Tasks]
; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required.
Name: "desktopicon"; Description: "Crear un acceso en el escritorio"; GroupDescription: " "; Flags: unchecked
[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Desinstalar"; Filename: "{uninstallexe}"

[code]
var
FolderTreeView1: TFolderTreeView;
Label1: TLabel;
procedure Cambio(Sender: TObject);
begin
Label1.Caption := FolderTreeView1.Directory;
end;
function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean;
var
Next, NextOK: Boolean;
CurSubPage: Integer;
begin
{ place subpages between 'Welcome'- and 'SelectDir' page }
if (not BackClicked and (CurPage = wpWelcome)) or (BackClicked and (CurPage = wpSelectDir)) then
begin
{ find startpage }
if not BackClicked then
CurSubPage := 0
else
CurSubPage := 1;
{ iterate through all subpages }
while (CurSubPage >= 0) and (CurSubPage <= 1) and not Terminated do
begin
ScriptDlgPageOpen();
ScriptDlgPageClearCustom();
{ insert subpage }
case CurSubPage of
0: // custompage 1
begin
ScriptDlgPageSetCaption('Instalación en Red');
ScriptDlgPageSetSubCaption1('Seleccione donde esta ubicada la base de datos');
ScriptDlgPageSetSubCaption2('');

{ Label1 }
Label1 := TLabel.Create(WizardForm.ScriptDlgPanel);
with Label1 do
begin
Parent := WizardForm.ScriptDlgPanel;
Left := 10;
Top := 10;
Width := 182;
Height := 13;
Caption := 'Selecciona un directorio y veras su ruta aqui!!!! ';
end;

{ FolderTreeView1 }
FolderTreeView1 := TFolderTreeView.Create(WizardForm.ScriptDlgPanel);
with FolderTreeView1 do
begin
Parent := WizardForm.ScriptDlgPanel;
Left := 30;
Top := 30;
Width := 350;
Height := 180;
Cursor := crArrow;
TabOrder := 0;
OnChange := @Cambio;
end;
Next := ScriptDlgPageProcessCustom();
NextOK := True;
end;
1: // custompage n
begin
end;
end;
{ check sub-page navigation }
if Next then
begin
if NextOK then
CurSubPage := CurSubPage + 1;
end
else
CurSubPage := CurSubPage - 1;
end;
{ check main-page navigation }
if not BackClicked then
Result := Next
else
Result := not Next;
ScriptDlgPageClose(not Result);
end
{ return default }
else
Result := True;
end;
{ NextButtonClick }
function NextButtonClick(CurPage: Integer): Boolean;
begin
Result := ScriptDlgPages(CurPage, False);
end;
{ BackButtonClick }
function BackButtonClick(CurPage: Integer): Boolean;
begin
Result := ScriptDlgPages(CurPage, True);
end;
Responder Con Cita