Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 19-12-2004
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Poder: 22
Héctor Randolph Va por buen camino
Cita:
Empezado por Yoli
lo quiero hacer obteniendo el serial del disco duro al momento de ejecurtase el instalador de la aplicacion (INNO SETUP)
Hola YOLI!

Aquí te muestro un script para conocer el serial del disco duro desde Inno Setup, espero que te sea útil.

Tomado de la página

Inno Setup Knowledge Base/How to get drive volumen and serial number

[code]


;
; ISX 3.0.6.2
;

[Setup]
AppName=DriveVolume
AppVerName=DriveVolume
Uninstallable=false
UpdateUninstallLogAppName=false
DisableDirPage=true
DisableProgramGroupPage=true
DefaultDirName={pf}\DriveVolume
DisableStartupPrompt=true

[_ISTool]
EnableISX=true

Código:
function GetVolumeInformation(
	lpRootPathName: PChar;
	lpVolumeNameBuffer: PChar;
	nVolumeNameSize: LongInt;
	var lpVolumeSerialNumber: LongInt;
	lpMaximumComponentLength: LongInt;
	lpFileSystemFlags : LongInt;
	lpFileSystemNameBuffer: PChar;
	nFileSystemNameSize: LongInt ) : Integer;
external '[email protected] stdcall';

{ // API declaration in C
BOOL GetVolumeInformation(
  LPCTSTR lpRootPathName,           // root directory
  LPTSTR lpVolumeNameBuffer,        // volume name buffer
  DWORD nVolumeNameSize,            // length of name buffer
  LPDWORD lpVolumeSerialNumber,     // volume serial number
  LPDWORD lpMaximumComponentLength, // maximum file name length
  LPDWORD lpFileSystemFlags,        // file system options
  LPTSTR lpFileSystemNameBuffer,    // file system name buffer
  DWORD nFileSystemNameSize         // length of file system name buffer
);
}

function GetLastError( ) : Integer;
external '[email protected] stdcall';

function InitializeSetup(): Boolean;

var srcdisk, volume: String;
    ercode: Integer; sernum: LongInt;
begin
  Result := true;

  srcdisk := AddBackslash( ExtractFileDrive( ExpandConstant('{srcexe}') ) );
  volume := StringOfChar( ' ', 16 );

  if GetVolumeInformation( srcdisk, volume, 15, sernum, 0, 0, '', 0 ) = 0 then
    begin
      ercode := GetLastError();
      MsgBox( SysErrorMessage( ercode ), mbError, MB_OK );
      Result := false;
    end
  else begin
    volume := CastIntegerToString( CastStringToInteger(volume) );
    MsgBox( Format3( 'Volume of %s is (%s) serial is %s', srcdisk, volume, IntToStr(sernum) )
      , mbInformation, MB_OK );
  end;
end;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 20:36:17.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi