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=
AppName=
AppVersion=
;AppVerName=
AppPublisher=
AppPublisherURL=
AppSupportURL=
AppUpdatesURL=
DefaultDirName=\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: ""; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "\\URL*"; DestDir: "\Asistencia"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; MinVersion: 0,6.0
Source: "\\URL\*"; DestDir: "\Vision Tecnologica\Biable"; Flags: ignoreversion createallsubdirs recursesubdirs
; NOTE: Dont use "Flags: ignoreversion" on any shared system files
Source: "\\URL.dll"; DestDir: "\Biable61"; Flags: regserver
Source: "\\URL*"; DestDir: "\Vision Tecnologica\Biable"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; MinVersion: 0,6.0
Source: "\\URL\*"; DestDir: "\Vision Tecnologica\Biable"; Flags: onlyifdoesntexist createallsubdirs recursesubdirs; OnlyBelowVersion: 0,6.0
Source: "c:\prj\Biable6\exe\insutils.dll"; Flags: dontcopy
[Icons]
Name: "\Bienvenido a Biable"; Filename: "\Vision Tecnologica\Biable\Ejemplos\Bienvenido.xls"
Name: "\Menú de Ejemplos"; Filename: "\Vision Tecnologica\Biable\Libros Ejemplo Biable.xls"
Name: "\Asistencia Remota"; Filename: "\Asistencia\vtsoporte.exe"
Name: "\Asistencia Remota (Version 3)"; Filename: "\Asistencia\vtsoporte3.exe"
Name: "\Manual de Usuario"; Filename: "\Biable\Ayuda\Manual de Usuario.pdf"
Name: "\}"; Filename: ""
Name: "\}"; Filename: ""
Name: "\Carpeta de Configuración"; Filename: "\Vision Tecnologica\Biable"; Languages: spanish
Name: "\Ayuda Local"; Filename: "\Biable\Ayuda\Biable.chm"
[Run]
Filename: "\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;
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;
begin
Log( 'InitializeSetup' );
Result := true;
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;
end;
procedure DoPostInstall( );
var
ExcelAddInFullName: String;
begin
Log( 'PostInstall' );
GenerateNewID( '{#MyAppName}' );
ExcelAddInFullName := ExpandConstant('{app}') + '\{#MyAppName}\{#MyAppName}.xla';
Log( 'DoPostInstall ' + ExcelAddInFullName );
HookAddinToExcel( '{#MyAppName}.xla', ExcelAddInFullName );
end;
procedure DoSuccessInstall();
var
TrustAddInsAndTemplates: Boolean;
TrustVBProject: Boolean;
MsgBoxResult: Integer;
begin
Log( 'DoSuccessInstall' );
TrustAddInsAndTemplates := IsTrustAddInsAndTemplatesChecked;
if (GetExcelVersionNumberAsNumber >= 10) then begin
TrustVBProject := IsTrustVBProjectChecked;
end else begin
TrustVBProject := true;
end;
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
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);
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssPostInstall:
DoPostInstall();
ssDone:
DoSuccessInstall();
end;
end;
Gracias por su ayuda.