Preparación del programa de instalación
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@35 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
parent
c6100549bb
commit
4ffb8ed4f5
99
Installer/Actualizacion/Actualización.iss
Normal file
99
Installer/Actualizacion/Actualización.iss
Normal file
@ -0,0 +1,99 @@
|
||||
[Setup]
|
||||
AppName=FactuGES
|
||||
AppVerName=FactuGES 2.0.6
|
||||
AppPublisher=Rodax Software S.L.
|
||||
AppPublisherURL=http://www.rodax-software.com
|
||||
AppSupportURL=http://www.rodax-software.com
|
||||
AppUpdatesURL=http://www.rodax-software.com
|
||||
OutputBaseFilename=instalar
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
CreateAppDir=no
|
||||
Uninstallable=no
|
||||
DisableStartupPrompt=yes
|
||||
DisableFinishedPage=yes
|
||||
|
||||
[Languages]
|
||||
Name: "sp"; MessagesFile: "compiler:languages\Spanish.isl"
|
||||
|
||||
[Files]
|
||||
Source: "files\*"; DestDir: {code:GetDir}; CopyMode: alwaysoverwrite; Flags: uninsneveruninstall overwritereadonly
|
||||
;Source: "files\Informes\*"; DestDir: "{code:GetDir}\Informes\"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
;Source: "files\Financiacion\*"; DestDir: "{code:GetDir}\Financiacion\"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
|
||||
[Registry]
|
||||
;Root: HKLM; Subkey: "Software\FactuGES\Update"; ValueType: string; ValueName: "edLocation_Text"; ValueData: "http://www.rodax-software.com/luisleon/update"; Flags: createvalueifdoesntexist
|
||||
|
||||
[Code]
|
||||
var
|
||||
TipoActualizacion : String;
|
||||
Ruta : String;
|
||||
VerAnterior : String;
|
||||
VerNueva : String;
|
||||
|
||||
function GetDir(Param: String): String;
|
||||
begin
|
||||
Result := Ruta;
|
||||
end;
|
||||
|
||||
procedure HacerBackupVerAnterior;
|
||||
var
|
||||
RutaBack : String;
|
||||
FindRec: TFindRec;
|
||||
begin
|
||||
RutaBack := Ruta + 'Otras versiones\' + VerAnterior + '\';
|
||||
|
||||
ForceDirectories(RutaBack);
|
||||
ForceDirectories(RutaBack + 'Informes');
|
||||
|
||||
FileCopy(Ruta + 'FactuGES.exe', RutaBack + 'FactuGES.exe', FALSE);
|
||||
if FindFirst(ExpandConstant(Ruta + 'Informes\*.*'), FindRec) then begin
|
||||
try
|
||||
repeat
|
||||
// Don't count directories
|
||||
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
|
||||
FileCopy(Ruta + 'Informes\' + FindRec.Name, RutaBack + 'Informes\' + FindRec.Name, FALSE);
|
||||
until not FindNext(FindRec);
|
||||
finally
|
||||
FindClose(FindRec);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{function NextButtonClick(CurPageID: Integer): Boolean;
|
||||
begin
|
||||
if CurPageID = 1 then
|
||||
begin
|
||||
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\FactuGES\Update',
|
||||
'TipoActualizacion', TipoActualizacion) then
|
||||
Abort;
|
||||
|
||||
if not DirExists(Ruta) then
|
||||
Abort;
|
||||
|
||||
if TipoActualizacion = 'INTERNET' then
|
||||
HacerBackupVerAnterior();
|
||||
end;
|
||||
Result := True;
|
||||
end;}
|
||||
|
||||
function InitializeSetup(): Boolean;
|
||||
var
|
||||
p: HWND;
|
||||
begin
|
||||
// Comprobar que FactuGES no está en ejecución
|
||||
p := FindWindowByWindowName('FactuGES');
|
||||
if p > 0 then
|
||||
begin
|
||||
MsgBox('Debe salir de FactuGES para poder instalar esta actualización',mbInformation, MB_OK);
|
||||
Result := False
|
||||
end
|
||||
else begin
|
||||
// Comprobar que la ruta del programa está en el registro
|
||||
Result := RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\FactuGES', 'Ruta', Ruta);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user