Files
ayanova7/Installs/AyaNovaOL/AyaNovaOL.iss

131 lines
4.7 KiB
Plaintext

[Setup]
AppName=AyaNova OLI plugin
AppVerName=AyaNova OLI plugin 7.6
AppPublisher=Ground Zero Tech-Works Inc.
AppPublisherURL=http://www.AyaNova.com/
AppSupportUrl=http://forum.ayanova.com
AppVersion=7.6.0
;App ID is used for updating and patching
;see: http://www.jrsoftware.org/iskb.php?updateinstall
AppId=AyaNovaOL
DefaultDirName={pf}\Ground Zero Tech-Works Inc.\AyaNova
DefaultGroupName=AyaNova
;UninstallDisplayIcon={app}\AyaNova.exe
LicenseFile=license.rtf
WizardImageFile=wizlarge.bmp
WizardImageStretch=no
WizardImageBackColor=clWhite
WizardSmallImageFile=wizsmall.bmp
;Hide page asking where shortcuts should go
DisableProgramGroupPage=Yes
;Hide page prompting user for install location as there is only one valid location
DisableDirPage=Yes
OutputBaseFilename=AyaNovaOLISetup
OutputDir=..
;"release" mode full compression
Compression=lzma/ultra
SolidCompression=true
InternalCompressLevel=ultra
[Files]
Source: "..\..\release\obfuscated\AyaNovaOL.dll"; DestDir: "{app}";Permissions: everyone-full;Flags:ignoreversion;
Source: "AyaNovaOL.dll.config"; DestDir: "{app}";Permissions: everyone-full;Flags:ignoreversion;
Source: "Extensibility.dll"; DestDir: "{app}";Permissions: everyone-full;Flags:ignoreversion;
;OfficeXP PIA Stuff
Source: "..\..\3rdprtylibs\OfficeXPPIA\Microsoft.Office.Interop.Outlook.dll"; DestDir: "{app}"
Source: "..\..\3rdprtylibs\OfficeXPPIA\stdole.dll"; DestDir: "{app}"
Source: "..\..\3rdprtylibs\OfficeXPPIA\office.dll"; DestDir: "{app}"
[Registry]
Root: HKLM; Subkey: "Software\Microsoft\Office\Outlook\AddIns\AyaNovaOL.Connect"; ValueType: string; ValueName: "Description"; ValueData: "Outlook plugin for AyaNova service management software";Flags:createvalueifdoesntexist uninsdeletekey;
Root: HKLM; Subkey: "Software\Microsoft\Office\Outlook\AddIns\AyaNovaOL.Connect"; ValueType: string; ValueName: "FriendlyName"; ValueData: "AyaNova OLI"
Root: HKLM; Subkey: "Software\Microsoft\Office\Outlook\AddIns\AyaNovaOL.Connect"; ValueType: dword; ValueName: "LoadBehavior"; ValueData: "3"
[Run]
Filename: "{dotnet40}\RegAsm.exe";Parameters: "AyaNovaOL.dll /codebase"; StatusMsg: "Registering AyaNovaOL.DLL"; WorkingDir:{app};Flags: runmaximized hidewizard;
[UninstallRun]
Filename: "{dotnet40}\RegAsm.exe";Parameters: "AyaNovaOL.dll /u"; StatusMsg: "Un-Registering AyaNovaOL.DLL"; WorkingDir:{app};
[Code]
function InitializeSetup(): Boolean;
begin
//FileExists(ExpandConstant('{app}\GZTW.AyaNova.BLL.dll'))
//Result := MsgBox('InitializeSetup:' #13#13 'Setup is initializing. Do you really want to start setup?', mbConfirmation, MB_YESNO) = idYes;
Result := FileExists(ExpandConstant('{pf}\Ground Zero Tech-Works Inc.\AyaNova\GZTW.AyaNova.BLL.dll'));
if Result = False then
MsgBox('AyaNova OL can not be installed without AyaNova!' #13#13 'AyaNova OL requires AyaNova files to run, so AyaNova must be installed and configured first.' #13#13 'This setup will now close.', mbInformation, MB_OK);
end;
{auto uninstall case 1422 stuff }
/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\AyaNovaOL_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
/////////////////////////////////////////////////////////////////////
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> '');
end;
/////////////////////////////////////////////////////////////////////
function UnInstallOldVersion(): Integer;
var
sUnInstallString: String;
iResultCode: Integer;
begin
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString
// default return value
Result := 0;
// get the uninstall string of the old app
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
begin
Result := 3;
end
else
Result := 2;
end else
Result := 1;
end;
/////////////////////////////////////////////////////////////////////
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
end;
end;
end;