[Setup]
AppID={code:GetAppID|''}
AppName=FactuGES2
AppVerName=FactuGES2 v{code:GetAppVersion}
AppPublisher=Rodax Software S.L.
AppPublisherURL=http://www.rodax-software.com
AppSupportURL=http://www.rodax-software.com
AppUpdatesURL=http://www.rodax-software.com
DefaultDirName={sd}\Rodax Software\FactuGES2
DefaultGroupName=FactuGES2
AllowNoIcons=true
OutputDir=Output
OutputBaseFilename=factuges2setup
Compression=lzma
SolidCompression=true
InfoBeforeFile=
InternalCompressLevel=ultra
MinVersion=0,5.01.2600

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

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: Input\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: version.dat
Source: Input\update.ico; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Input\version.dat; DestDir: {tmp}; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: {group}\FactuGES2; Filename: {app}\FactuGES.exe; WorkingDir: {app}
Name: {userdesktop}\FactuGES2; Filename: {app}\FactuGES.exe; Tasks: desktopicon; WorkingDir: {app}; Languages: 
Name: {group}\Comprobar actualizaciones; Filename: {app}\FactuGES.exe; WorkingDir: {app}; Parameters: CheckNow; Comment: Comprobar si hay nuevas actualizaciones de FactuGES2; IconFilename: {app}\update.ico
Name: {group}\{cm:UninstallProgram,FactuGES2}; Filename: {uninstallexe}

[Run]
Filename: {app}\FactuGES.exe; Description: {cm:LaunchProgram,FactuGES2}; Flags: nowait postinstall skipifsilent

[Registry]
Root: HKLM; Subkey: Software\Rodax Software; ValueType: string; ValueName: Version; ValueData: {code:GetAppVersion|''}; Flags: uninsdeletekey

[LangOptions]
LanguageName=Spanish
LanguageID=$0C0A

[Code]
function GetAppVersion(param: String): String;
	var
		AppVersion: String;
	begin
		ExtractTemporaryFile('version.dat');
		LoadStringFromFile(ExpandConstant('{tmp}\version.dat'), AppVersion);
		Result := AppVersion;
	end;

function GetAppID(param: String): String;
	begin
		Result := 'FactuGES2';
	end;
