Ver Mensaje Individual
  #6  
Antiguo 16-12-2014
diegoferxmr diegoferxmr is offline
Registrado
NULL
 
Registrado: dic 2014
Posts: 3
Reputación: 0
diegoferxmr Va por buen camino
Hola a todos.
Tengo el código así, pero no me funciona: (Ver la parte de ifFileExist)

Código Delphi [-]
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Biable"
#define MyAppVersion "6.1"
#define MyAppPublisher "Visión Tecnológica S.A.S."
#define MyAppURL "http:..."

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{XXXXXXXX-XXXXX-XXXXX-XXXXXXXXXX}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Vision Tecnologica
LicenseFile=\\URL
InfoBeforeFile=\\URL
OutputBaseFilename=biabledemo
Compression=lzma
SolidCompression=yes
ShowLanguageDialog=no
LanguageDetectionMethod=none
PrivilegesRequired=none
AllowRootDirectory=True
MinVersion=4.10,5.01
DisableProgramGroupPage=auto
SetupLogging=yes
AlwaysShowGroupOnReadyPage=True
AlwaysShowDirOnReadyPage=True
DisableDirPage=auto
DefaultGroupName=Biable 6.1

[Languages]
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Files]
Source: "\\URL*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "\\URL*"; DestDir: "{app}\Asistencia"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; MinVersion: 0,6.0
Source: "\\URL\*"; DestDir: "{commondocs}\Vision Tecnologica\Biable"; Flags: ignoreversion createallsubdirs recursesubdirs
; NOTE: Dont use "Flags: ignoreversion" on any shared system files
Source: "\\URL.dll"; DestDir: "{app}\Biable61"; Flags: regserver
Source: "\\URL*"; DestDir: "{userappdata}\Vision Tecnologica\Biable"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; MinVersion: 0,6.0
Source: "\\URL\*"; DestDir: "{userappdata}\Vision Tecnologica\Biable"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; OnlyBelowVersion: 0,6.0
Source: "c:\prj\Biable6\exe\insutils.dll"; Flags: dontcopy

[Icons]
Name: "{group}\Bienvenido a Biable"; Filename: "{commondocs}\Vision Tecnologica\Biable\Ejemplos\Bienvenido.xls"
Name: "{group}\Menú de Ejemplos"; Filename: "{commondocs}\Vision Tecnologica\Biable\Libros Ejemplo Biable.xls"
Name: "{group}\Asistencia Remota"; Filename: "{app}\Asistencia\vtsoporte.exe"
Name: "{group}\Asistencia Remota (Version 3)"; Filename: "{app}\Asistencia\vtsoporte3.exe"
Name: "{group}\Manual de Usuario"; Filename: "{app}\Biable\Ayuda\Manual de Usuario.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Carpeta de Configuración"; Filename: "{commondocs}\Vision Tecnologica\Biable"; Languages: spanish
Name: "{group}\Ayuda Local"; Filename: "{app}\Biable\Ayuda\Biable.chm"

[Run]
Filename: "{commondocs}\Vision Tecnologica\Biable\Ejemplos\Bienvenido.xls"; Flags: nowait postinstall runasoriginaluser shellexec; Description: "Ejecutar Microsoft Excel"

[code]
#include "addins.iss"

 function  GenerateNewID(AppName: AnsiString): integer; 
 external 'GenerateNewID@files:insutils.dll stdcall setuponly delayload';

//*******************************************************************************
procedure MsgInstall();
begin
  MsgBox('Se Instalara el Programa: ' + CurrentFileName, mbInformation, MB_OK);
end;

// Realiza el Setup en función de un archivo de control
function InitializeSetup(): Boolean;
begin
  if FileExists('{app}\Biable\Biable.xla') then 
  begin 
    MsgBox('Setup Cancelado por Existencia de archivo de Biable', mbInformation, MB_OK);
    Result := False;
  end
  else
    Result := True;
end;
//*******************************************************************************
(*
  Called during Setup's initialization. Return False to abort Setup, True otherwise.
*)
begin
  Log( 'InitializeSetup' );
  // Default.
  //
  Result := true;
  // The Add-In does not (yet) work with 64-bit Excel. We warn and Exit immediately.
  //
  If IsExcel64Bit() then begin
    MsgBox('Este equipo tiene instalado Microsoft Excel a 64-bits y no está soportado.' + #13#10 + #13#10 +
      '{#MyAppName} está diseñando para trabajar con Microsoft Excel 32-bits solamente ' +
      'y no se instalará. Instale Microsoft Excel 32-bits y ejecute de nuevo la instalación de {#MyAppName}.' + #13#10 + #13#10 +
      'Contacte al personal de sistemas para recibir asistencia.', mbInformation, mb_Ok);
    Result := false;
    Exit;
  end;
  // Load previous choices
  //
//  InstallMode := StrToIntDef(GetPreviousData('InstallMode', '0'), 0);
//  SamplesPath := GetPreviousData('SamplesPath', GetExpandedConstant('{userdocs}', '{commondocs}', '') + '\My {#TheAppVeryShortName} Projects\Samples');
//  HTMLHelpPath := GetPreviousData('HTMLHelpPath', GetExpandedConstant('{sd}', '', '') + '\{#TheAppVeryShortName} HTML Help');
//  LexiconPath := GetPreviousData('LexiconPath', GetExpandedConstant('{userdocs}', '{commondocs}', '') + '\My {#TheAppVeryShortName} Lexicons');
end;



procedure DoPostInstall(  );
(*
  Post-Installation procedure. Runs after performing all installation actions.
*)
var
  ExcelAddInFullName: String;
begin
  Log( 'PostInstall' );
  GenerateNewID( '{#MyAppName}' );
  ExcelAddInFullName := ExpandConstant('{app}') + '\{#MyAppName}\{#MyAppName}.xla';
  Log( 'DoPostInstall ' + ExcelAddInFullName );   
  HookAddinToExcel( '{#MyAppName}.xla', ExcelAddInFullName );
end;


procedure DoSuccessInstall();
(*
  Successful Installation procedure. Runs after performing all actions.
*)
var
  TrustAddInsAndTemplates: Boolean;
  TrustVBProject: Boolean;
  MsgBoxResult: Integer;
begin
  Log( 'DoSuccessInstall' );
  // Check Trust to Add-Ins and Templates (for all versions)
  //
  TrustAddInsAndTemplates := IsTrustAddInsAndTemplatesChecked;

  // Check in Access To Visual Basic Project is enabled in Excel.
  // Note: Excel 2000 does not have this setting.
  //
  if (GetExcelVersionNumberAsNumber >= 10) then begin
    TrustVBProject := IsTrustVBProjectChecked;
  end else begin
    TrustVBProject := true;
  end;

  // If one of the 2 is not set, then issue a warning message.
  //
  if not TrustAddInsAndTemplates or not TrustVBProject then begin
    if IsRunningSilent then begin
      Log('Warning: Macro Security Trust settings not properly set. {#MyAppName} may not work properly.');
    end else begin
      // Just a message.
      // Comment this statement and uncomment next statement if you want to set.
      //
      MsgBoxResult := MsgBox('Information: Macro Security Trust settings not properly set.' + #13#10 + #13#10 +
        'To operate with {#MyAppName}, the Trust settings in the Macro Security must be set differently.' + #13#10 + #13#10 +
        'Contact a System Administrator for assistance.', mbInformation, mb_Ok);

//      // A question whether this shall be turned on right now?
//      // Uncomment this statement and comment previous statement if you want to set.
//      //
//      MsgBoxResult := MsgBox('Information: Macro Security Trust settings not properly set.' + #13#10 + #13#10 +
//        'To operate with {#MyAppName}, the Trust settings in the Macro Security must be set differently.' + #13#10 + #13#10 +
//        'Would you like to do this right now?', mbConfirmation, mb_YesNo);
//      //
//      if (MsgBoxResult = IDYES) then begin
//        if not SetTrustAddInsAndTemplates and not SetTrustVBProject then begin
//          MsgBox('Warning: could not set required Macro Security Trust settings.' + #13#10 + #13#10 +
//            'You may not have sufficient privileges to perform this action. Before you can operate with' + #13#10 +
//            '{#MyAppName}, remember to check and/or set these setting in Microsoft Excel.' + #13#10 + #13#10 +
//            'Contact a System Administrator for assistance.', mbInformation, mb_Ok);
//        end;
//      end;
    end;
  end;
end;


procedure CurStepChanged(CurStep: TSetupStep);
begin
  case CurStep of
//  ssInstall:
//    DoPreInstall();
  ssPostInstall:
    DoPostInstall();
  ssDone:
    DoSuccessInstall();
  end;
end;

Gracias por su ayuda.
Responder Con Cita