How to determine the Office version programmatically using the Inno Setup? - ms-office

I have two types of Office add-ins – one for Office 2013 and another for other versions (2003-2010).
I use Inno Setup for distribution package.
Is it possible to determine the Office version that installed on target machine and than to run the right installation file?
I tried to write the code that detects the Word version and installs appropriate files but I failed to compile it. Since this is the first time that I write such a code, I would like to ask you to take a look on my code.
[Files]
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013.exe"; DestDir: "{app}"; Check: "Install2013"; MinVersion: 0.0,5.0;
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010.exe"; DestDir: "{app}"; Check: "Install2010"; MinVersion: 0.0,5.0;
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013x86.dll"; DestDir: "{app}"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 32bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013x64.dll"; DestDir: "{app}"; Check: "Install2013 and Is64BitInstallMode"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 64bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010x84.dll"; DestDir: "{app}"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 32bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010x64.dll"; DestDir: "{app}"; Check: "Install2010 and Is64BitInstallMode"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 64bit
Root: HKCU; Subkey: "Software\My Program\AppforWord"; ValueName: "AppBarStyle"; ValueType: String; ValueData: "1"; Components: "AppforWord"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforExcel"; ValueName: "Enable"; ValueType: String; ValueData: "2"; Components: "AppforWord"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforWord"; ValueName: "AppBarStyle"; ValueType: String; ValueData: "1"; Components: "AppforWord"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforExcel"; ValueName: "Enable"; ValueType: String; ValueData: "2"; Components: "AppforWord"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
[Icons]
Name: "{commondesktop}\MyProg 2013"; Filename: "{app}\MyProg2013.exe"; Comment: "The settings for My Program 2013"; Check: "Install2013"; MinVersion: 0.0,5.0;
Name: "{commondesktop}\MyProg 2010"; Filename: "{app}\MyProg2010.exe"; Comment: "The settings of My Program"; Check: "Install2010"; MinVersion: 0.0,5.0;
[Code]
{ Get office version }
function IsInstall2013(): boolean;
var
success: boolean;
OfficeVer: cardinal;
begin
success :=
RegQueryDWordValue(
HKEY_CLASSES_ROOT, 'Word.Application\CurVer', Word.Application.15' );
Result := success and (OfficeVer = Word.Application.15);
end;
{ RETURNS OPPOSITE OF IsInstall2013 FUNCTION }
function Install2013(): Boolean;
begin
Result := (IsInstall2013 = false);
end;
{ RETURNS OPPOSITE OF not Office2013 FUNCTION }
function Install2010(): Boolean;
begin
Result := (IsInstall2010 = true);
end;
Since I also would like to create an Inno Setup installation routine which detects the version of Office someone is using. I have tried various iterations of the above code and can't seem to get things to work.
My objective is simple... install files A,B,C if someone is using Office 2010. If someone is using Office 2013, install files D,E,F,.

Related

Inno Setup remove specific reg key after uninstall

I try to remove a registry key after uninstalling it in Windows, but I couldn't get it working somehow. I tried everything which was listed here: Inno Setup: Removing a problematic registry key left by another program
I checked different docs of Inno Setup:
https://jrsoftware.org/ishelp/index.php?topic=uninstalldeletesection
https://jrsoftware.org/ishelp/index.php?topic=isxfunc_regdeletekeyincludingsubkeys
https://jrsoftware.org/ishelp/index.php?topic=registrysection
https://jrsoftware.org/ishelp/index.php?topic=isxfunc_regdeletevalue
I ended up with this:
; Basic setup for a JavaFX application
#define AppName "Practicumopdracht OOP2"
#define AppVersion "1.0.0"
#define AppPublisher "Remzi Cavdar"
#define AppURL "https://twitter.com/remzicavdar"
#define AppExeName "practicumopdracht.jar"
#define AppExeDir "C:\Users\Remzi\Projects\student-1\out\artifacts\practicumopdracht_jar"
#define AppIcon "app.ico"
#define ProjectDir "C:\Users\Remzi\Projects\JavaFX-Setup"
[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={{DD7E7C3F-F4AC-4D76-8626-95019C15E111}
AppName={#AppName}
AppVersion={#AppVersion}
VersionInfoVersion=1.0.0.0
VersionInfoCopyright={#AppPublisher} - ict#remzi.info
AppVerName={#AppName}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={localappdata}\Remzi Cavdar\{#AppName}
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
OutputBaseFilename=Setup-practicumopdracht
Compression=lzma
SolidCompression=yes
WizardStyle=modern
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\{#AppIcon}
MinVersion=10.0.10240
[Languages]
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "{#AppExeDir}\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#ProjectDir}\{#AppIcon}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#ProjectDir}\Input\OpenJDK19U-jre_x64_windows_hotspot_19_36.msi"; DestDir: "{tmp}"; AfterInstall: RunJavaInstaller
[Icons]
Name: "{autoprograms}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\{#AppIcon}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\{#AppIcon}"; Tasks: desktopicon
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store"; ValueType: binary; ValueName: "{app}\unins000.exe"; Flags: dontcreatekey uninsdeletevalue
[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent
[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\Remzi Cavdar"
[Code]
procedure RunJavaInstaller;
var
ErrorCode: Integer;
begin
if not ShellExec('', 'msiexec.exe', ExpandConstant('/i "{tmp}\OpenJDK19U-jre_x64_windows_hotspot_19_36.msi" ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome,FeatureOracleJavaSoft /qb'), '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode)
then
MsgBox('Java JRE installer failed to run!' + #13#10 + ' ' + SysErrorMessage(ErrorCode), mbError, MB_OK);
end;
This is what I'm trying to remove after uninstall:
I found a solution to my registry question. I needed to check for both 32-bit and 64-bit.
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store"; ValueType: binary; ValueName: "{app}\unins000.exe"; Flags: dontcreatekey uninsdeletevalue
Root: HKCU64; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store"; ValueType: binary; ValueName: "{app}\unins000.exe"; Flags: dontcreatekey uninsdeletevalue; Check: IsWin64
I found the answer here: Writing 32/64-bit specific registry key in Inno Setup and https://jrsoftware.org/ishelp/index.php?topic=registrysection also mention this with HKLM64 example, but I read things to fast to notice it.

Ready to Install wizard page looks empty

These are the wizard pages of my Inno Setup installer:
Window 1:
Window 2:
Window 3:
Window 4:
Window 5:
My issue is with wizard page 4. It seems odd having this page look like that.
Is this standard behaviour?
Should something be displayed to the user?
Suppress this page?
This is my script:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[ISPP]
; Please, don't edit this section manually if you don't know what are you doing.
#define Skin "Metallics.cjstyles"
#define ThisYear GetDateTimeString('yyyy', '', '');
#define VR "VisitsRota"
#define SourceDir "..\Release"
#define DataDir "{userappdata}\" + VR
#define CommonDataDir "{commonappdata}\" + VR
#define AppURL "http://www.publictalksoftware.co.uk"
#define AppPublisher "Andrew Truckle"
#define AppVerText() \
ParseVersion(SourceDir + '\VisitsRota.exe', \
Local[0], Local[1], Local[2], Local[3]), \
Str(Local[0]) + "." + Str(Local[1]) + "." + Str(Local[2])
; SignTool parameters
#define SignedDesc "$q" + VR + "$q"
#define SignedPfx "$qd:\My Certificate\2018\My Certificate.pfx$q"
#define SignedTimeStamp "$qhttp://timestamp.verisign.com/scripts/timestamp.dll$q"
#define SignedPw "$q~~~~~~$q"
#define LANG_ENG "0"
#define LANG_ESP "1"
#define LANG_ITA "2"
#define LANG_PTB "3"
#define LANG_SVE "4"
#define LANG_FRA "5"
#define LANG_FIN "6"
#define LANG_PLK "7"
#define LANG_DAN "8"
#define LANG_NLD "9"
#define LANG_UKR "10"
#define LANG_DEU "11"
#define LANG_AFK "12"
#define LANG_RUS "13"
#define LANG_CSY "14"
#define LANG_SQI "15"
#define LANG_TRK "16"
#define LANG_ELL "17"
#define LANG_HUN "18"
[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={{ECBAEED1-C909-4CF6-B94D-9AF095ACF2E1}
AppName={#VR}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
AppVersion={#AppVerText}
VersionInfoVersion={#AppVerText}
VersionInfoCompany={#AppPublisher}
VersionInfoDescription={#VR}
VersionInfoTextVersion={#AppVerText}
VersionInfoCopyright={#AppPublisher} © 2008 - {#ThisYear}
DefaultDirName={pf}\{#VR}
DefaultGroupName={#VR}
OutputBaseFilename=VisitsRotaSetup
Compression=lzma
SolidCompression=yes
AppMutex={{1D942130-98DF-4F52-8F6E-A68E3D4FC57E}
WizardImageFile=Images\vr???x???.bmp
WizardSmallImageFile=Images\vricon*.bmp
MinVersion=0,5.0
AppCopyright={#AppPublisher} © 2003 - {#ThisYear}
SignTool=SignTool /d {#SignedDesc} /du $q{#AppURL}$q /f {#SignedPfx} /p {#SignedPw} /t {#SignedTimeStamp} /v $f
SignedUninstaller=yes
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; MinVersion: 4,4
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; MinVersion: 4,4; Flags: unchecked
[Languages]
Name: "English"; MessagesFile: "compiler:Default.isl"; LicenseFile: ".\License\LicenseENG.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Spanish"; MessagesFile: "compiler:Languages\Spanish.isl"; LicenseFile: ".\License\LicenseESP.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Italian"; MessagesFile: "compiler:Languages\Italian.isl"; LicenseFile: ".\License\LicenseITA.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "PortugueseBrazil"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"; LicenseFile: ".\License\LicensePTB.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Swedish"; MessagesFile: "compiler:Languages\Swedish.isl"; LicenseFile: ".\License\LicenseSVE.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "French"; MessagesFile: "compiler:Languages\French.isl"; LicenseFile: ".\License\LicenseFRA.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Finnish"; MessagesFile: "compiler:Languages\Finnish.isl"; LicenseFile: ".\License\LicenseFIN.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Polish"; MessagesFile: "compiler:Languages\Polish.isl"; LicenseFile: ".\License\LicensePLK.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Danish"; MessagesFile: "compiler:Languages\Danish.isl"; LicenseFile: ".\License\LicenseDAN.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Dutch"; MessagesFile: "compiler:Languages\Dutch.isl"; LicenseFile: ".\License\LicenseNLD.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"; LicenseFile: ".\License\LicenseUKR.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "German"; MessagesFile: "compiler:Languages\German.isl"; LicenseFile: ".\License\LicenseDEU.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Afrikaans"; MessagesFile: "compiler:Languages\Afrikaans.isl"; LicenseFile: ".\License\LicenseAFK.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Russian"; MessagesFile: "compiler:Languages\Russian.isl"; LicenseFile: ".\License\LicenseRUS.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Czech"; MessagesFile: "compiler:Languages\Czech.isl"; LicenseFile: ".\License\LicenseCSY.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Albanian"; MessagesFile: "compiler:Languages\Albanian.isl"; LicenseFile: ".\License\LicenseSQI.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Turkish"; MessagesFile: "compiler:Languages\Turkish.isl"; LicenseFile: ".\License\LicenseTRK.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Greek"; MessagesFile: "compiler:Languages\Greek.isl"; LicenseFile: ".\License\LicenseENG.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
Name: "Hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"; LicenseFile: ".\License\LicenseHUN.rtf"; InfoBeforeFile: "RevisionHistory.rtf"
[Files]
Source: "..\Release\VisitsRota.exe"; DestDir: "{app}"; Flags: ignoreversion sign
Source: "..\x64\Release\VisitsRota.exe"; DestDir: "{app}"; DestName: "VisitsRota_x64.exe"; Flags: ignoreversion sign
Source: "..\HelpNDoc\CHM\VisitsRota.chm"; DestDir: {app}; Flags: ignoreversion
Source: "..\Release\VisitsRotaESP.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaITA.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaPTB.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaSVE.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaFRA.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaFIN.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaPLK.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaDAN.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaNLD.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaUKR.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaDEU.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaAFK.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaRUS.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaCSY.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaSQI.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaTRK.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaELL.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "..\Release\VisitsRotaHUN.dll"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion
Source: "Styles\ElderlyInfirm-Schedule-v1.css"; DestDir: "{#CommonDataDir}"; Flags: overwritereadonly ignoreversion uninsremovereadonly touch; Attribs: readonly
Source: "Styles\ElderlyInfirm-Schedule-v1.xsl"; DestDir: "{#CommonDataDir}"; Flags: overwritereadonly ignoreversion uninsremovereadonly touch; Attribs: readonly
Source: "Styles\Shepherd-Schedule-v1.css"; DestDir: "{#CommonDataDir}"; Flags: overwritereadonly ignoreversion uninsremovereadonly touch; Attribs: readonly
Source: "Styles\Shepherd-Schedule-v1.xsl"; DestDir: "{#CommonDataDir}"; Flags: overwritereadonly ignoreversion uninsremovereadonly touch; Attribs: readonly
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: ISSkinU.dll; DestDir: {app}; Flags: dontcopy
; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Skins\{#Skin}; DestDir: {tmp}; Flags: dontcopy
[Icons]
Name: {group}\{#VR}; Filename: {app}\VisitsRota.exe
Name: {group}\{#VR} (64 bit); Filename: {app}\VisitsRota_x64.exe;
Name: "{userdesktop}\{#VR}"; Filename: {app}\VisitsRota.exe; Tasks: desktopicon;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#VR}"; Filename: {app}\VisitsRota.exe; MinVersion: 4,4; Tasks: quicklaunchicon;
; Name: {group}\VisitsRota Help; Filename: {app}\VisitsRota.chm; WorkingDir: {app}; IconFilename: {win}\hh.exe; IconIndex: 0
; Name: {group}\VisitsRota Help (Suomi); Filename: {app}\VisitsRotaFIN.chm; WorkingDir: {app}; IconFilename: {win}\hh.exe; IconIndex: 0
[Run]
Filename: "{app}\VisitsRota.exe"; Description: {cm:LaunchProgram,VisitsRota}; Flags: nowait postinstall skipifsilent runasoriginaluser
Filename: "{app}\VisitsRota_x64.exe"; Flags: nowait postinstall runasoriginaluser unchecked skipifsilent; Description: "{cm:LaunchProgram,VisitsRota (64 bit)}"; Check: IsWin64
[Registry]
Root: "HKLM"; Subkey: "Software\TruckleSoft\VisitsRota"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}\VisitsRota.exe"
Root: "HKLM64"; Subkey: "Software\TruckleSoft\VisitsRota"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}\VisitsRota_x64.exe"; Check: IsWin64
; Language value is based on the language that the user has installed with
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ENG}; Languages: English; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ESP}; Languages: Spanish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ITA}; Languages: Italian; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_PTB}; Languages: PortugueseBrazil; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_SVE}; Languages: Swedish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_FRA}; Languages: French; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_FIN}; Languages: Finnish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_PLK}; Languages: Polish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_DAN}; Languages: Danish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_NLD}; Languages: Dutch; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_UKR}; Languages: Ukrainian; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_DEU}; Languages: German; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_AFK}; Languages: Afrikaans; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_RUS}; Languages: Russian; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_CSY}; Languages: Czech; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_SQI}; Languages: Albanian; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_TRK}; Languages: Turkish; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ELL}; Languages: Greek; Flags: uninsdeletevalue
Root: HKLM; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_HUN}; Languages: Hungarian; Flags: uninsdeletevalue
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ENG}; Languages: English; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ESP}; Languages: Spanish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ITA}; Languages: Italian; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_PTB}; Languages: PortugueseBrazil; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_SVE}; Languages: Swedish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_FRA}; Languages: French; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_FIN}; Languages: Finnish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_PLK}; Languages: Polish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_DAN}; Languages: Danish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_NLD}; Languages: Dutch; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_UKR}; Languages: Ukrainian; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_DEU}; Languages: German; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_AFK}; Languages: Afrikaans; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_RUS}; Languages: Russian; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_CSY}; Languages: Czech; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_SQI}; Languages: Albanian; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_TRK}; Languages: Turkish; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_ELL}; Languages: Greek; Flags: uninsdeletevalue; Check: IsWin64
Root: HKLM64; Subkey: Software\TruckleSoft\VisitsRota; ValueType: dword; ValueName: Language; ValueData: {#LANG_HUN}; Languages: Hungarian; Flags: uninsdeletevalue; Check: IsWin64
[Dirs]
Name: "{#DataDir}"; Flags: uninsalwaysuninstall
[InstallDelete]
Type: files; Name: "{app}\VisitsRotaENU.dll"
[Code]
program Setup;
// global variables
var
bIsUpgrading: Boolean;
// Importing LoadSkin API from ISSkinU.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin#files:isskinU.dll stdcall';
// Importing UnloadSkin API from ISSkinU.DLL
procedure UnloadSkin();
external 'UnloadSkin#files:isskinU.dll stdcall';
// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow#user32.dll stdcall';
// Returns the path where the program was last installed
function GetPathInstalled( AppID: String ): String;
var
sPrevPath: String;
begin
sPrevPath := '';
if not RegQueryStringValue( HKLM,
'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
'Inno Setup: App Path', sPrevpath) then
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
'Inno Setup: App Path', sPrevpath);
Result := sPrevPath;
end;
// Returns True if we are performing an upgrade
function IsUpgrading(): Boolean;
var
sPrevPath: String;
begin
sPrevPath := GetPathInstalled('{~~~~~}');
if (Length(sPrevPath) > 0) and (FileExists(sPrevPath + '\VisitsRota.exe' )) then
Result := True
else
Result := False;
end;
function MakeVersion(Major, Minor, Build: Cardinal): Cardinal;
begin
Result := (Major shl 24) + (Minor shl 16) + Build;
end;
// Called just before setup is about to start
function InitializeSetup(): Boolean;
var
WindowsVersion: Cardinal;
begin
Result := True;
ExtractTemporaryFile('{#Skin}');
LoadSkin(ExpandConstant('{tmp}\{#Skin}'), '');
// Are we performing an upgrade?
bIsUpgrading := IsUpgrading();
// Check Windows Version
WindowsVersion := GetWindowsVersion;
Log(Format('Windows Version: %x', [WindowsVersion]));
// Windows must be Win 7 SP1 (6.1.7601), Win 8.1 (6.3.9200) or higher, eg: Win 10 (10.0.10240)
// See: http://www.jrsoftware.org/ishelp/index.php?topic=winvernotes
// Microsoft .Net Framework 4.6.2 will only work with these operating systems.
if (WindowsVersion < MakeVersion(6, 1, 7601)) or
((WindowsVersion >= MakeVersion(6, 2, 0)) and (WindowsVersion < MakeVersion(6, 3, 0))) then
begin
MsgBox(SetupMessage(msgWindowsVersionNotSupported), mbError, MB_OK);
Result := False;
end;
end;
type
TRunEntry = record
Caption: string;
Checked: Boolean;
Object: TObject;
end;
procedure RebuildRunList;
var
RunEntries: array of TRunEntry;
I: Integer;
begin
// Save run list ...
SetArrayLength(RunEntries, WizardForm.RunList.Items.Count);
for I := 0 to WizardForm.RunList.Items.Count - 1 do
begin
RunEntries[I].Caption := WizardForm.RunList.ItemCaption[I];
RunEntries[I].Checked := WizardForm.RunList.Checked[I];
RunEntries[I].Object := WizardForm.RunList.ItemObject[I];
end;
// ... clear it ...
WizardForm.RunList.Items.Clear;
// ... and re-create
for I := 0 to GetArrayLength(RunEntries) - 1 do
begin
// the first three entries are radio buttons
if (I = 0) or (I = 1) or (I = 2) then
begin
WizardForm.RunList.AddRadioButton(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, RunEntries[I].Object);
end
else
begin
WizardForm.RunList.AddCheckBox(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, True, True,
RunEntries[I].Object);
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
// Only now is the RunList populated.
// Two entries are on 64-bit systems only.
if IsWin64 then RebuildRunList;
end;
end;
procedure DeinitializeSetup();
begin
// Hide Window before unloading skin so user does not get
// a glimpse of an unskinned window before it is closed.
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;
Update
If I uninstall the program and try to install, then wizard 4 looks better:
I get it - doh! When I am "upgrading" and I don't tick the tasks, then there is nothing to show on the "Ready to Install" page. If I check one of the options then something will be displayed. At least I know what was happening now.
Yes, when there's nothing to show on the changes list, the list is hidden.
You can force displaying something, for example by:
AlwaysShowDirOnReadyPage or AlwaysShowGroupOnReadyPage directives.
[Setup]
AlwaysShowDirOnReadyPage=yes
AlwaysShowGroupOnReadyPage=yes
Using UpdateReadyMemo event function:
[Code]
procedure AppendReadyMemo(var Memo: string; NewLine: string; S: string);
begin
if S <> '' then
begin
if Memo <> '' then Memo := Memo + NewLine + NewLine;
Memo := Memo + S;
end;
end;
function UpdateReadyMemo(
Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo,
MemoGroupInfo, MemoTasksInfo: String): String;
begin
{ This is what Inno Setup would do without UpdateReadyMemo }
AppendReadyMemo(Result, NewLine, MemoUserInfoInfo);
AppendReadyMemo(Result, NewLine, MemoDirInfo);
AppendReadyMemo(Result, NewLine, MemoTypeInfo);
AppendReadyMemo(Result, NewLine, MemoComponentsInfo);
AppendReadyMemo(Result, NewLine, MemoGroupInfo);
AppendReadyMemo(Result, NewLine, MemoTasksInfo);
if Result = '' then
begin
Result := 'Keeping settings from previous installations';
end;
end;

Creating shortcut in user Start menu from elevated Inno Setup installer

During its lifetime, MyApp creates extra shortcuts to Userappdata,
MyAppGroupName\MyAppShortcut#2
MyAppGroupName\MyAppShortcut#3
...
yet as Inno Setup requires elevation because of registry Association edits the original {Group} item is inserted in a different (commonstartmenu) directory:
MyAppGroupName\MyAppShortcutAtInstallation
Very happy with the {Group} flavour in the install so
DisableProgramGroupPage=yes
is not an option at this stage. Else creating paths in Dirs like
{Userappdata}\MyAppGroupName
doesn't appear to function in the current script:
...
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
ChangesAssociations = yes
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
; (Note: Scroll to the right to see the full lines!)
Source: "Test.exe"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Registry]
Root: HKCU; Subkey: "Software\Auth/MyApp"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Auth\MyApp"; ValueType: string; ValueName: "Name"; ValueData: "{app}";
;Association
Root: HKCR; Subkey: ".XXX";ValueData: "{#MyAppName}";Flags: uninsdeletevalue; ValueType: string; ValueName: ""
Root: HKCR; Subkey: "{#MyAppName}";ValueData: "Program {#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: ""
Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon";ValueData: "{app}\{#MyAppExeName},0";ValueType: string; ValueName: ""
Root: HKCR; Subkey: "{#MyAppName}\shell\open\command";ValueData: """{app}\{#MyAppExeName}"" ""%1""";ValueType: string;ValueName: ""
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: en; MessagesFile: "compiler:Default.isl"
Name: deu; MessagesFile: "compiler:Languages\German.isl"
Name: es; MessagesFile: "compiler:Languages\Spanish.isl"
[Dirs]
Name: "{userstartmenu}\{userstartmenu}\{#MyAppName}"
[UninstallDelete]
Type: files; Name: "{#MyAppName}.chw"
Is there any known method of pointing {Group} to {Userappdata} in an elevated scenario? Or any other helpers e.g. here?
If I understand your question correctly you are looking for a combination of {userprograms} and {groupname}:
[Icons]
Name: "{userprograms}\{groupname}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Though note that:
Your approach is flawed in general. An installer should not both require elevation and modify environment of a specific user. The elevation can change user context (e.g. if Administrator account is distinct to the regular user account). So you do not know, if the "user" is the right user.
Using groups in Start menu is against Windows guidelines for Windows 8 and newer.

Keep getting compiler error period ('.') expected - Inno Setup

Have never used Inno Setup before and with the help of people on stack overflow have managed to figure out most of it. However I have rewritten this setup many times as I keep getting a period ('.') expected and hilited line is end:
If I change the semi colon to a period the compile will run with erratic results.
For example in a basic setup which is working if I add the following to my Pascal Code section after the procedure InitializeWizard(); I get the error
var
teula : string;
PrintButton : TButton;
Page : TWizardPage;
SStatic : TNewStaticText;
begin
teula := 'Click next to accept the EULA (click button at right)';
PrintButton := TButton.Create(page);
PrintButton.Caption := 'Toolbar EULA';
PrintButton.Left :=355;
PrintButton.Width :=150;
PrintButton.Top :=286;
PrintButton.onClick := #PrintButtonClick;
PrintButton.Parent := WizardForm;
SStatic := TNewStaticText.Create(Page);
SStatic.Left :=10;
SStatic.Top :=290;
SStatic.Width :=200;
SStatic.Parent := WizardForm;
SStatic.Caption := teula;
end;
This is the entire listing.
; ///////////////////////////////////////////////////////////
; // Graphical Installer for Inno Setup //
; // Version v3.3.01 (Katka) //
; // Copyright (c) 2011 - 2013 unSigned Softworks //
; // www.unsigned-softworks.sk www.graphical-installer.com //
; // info#unsigned-softworks.sk //
; // All rights reserved. //
; ///////////////////////////////////////////////////////////
; *********************************************
; * Main script file. *
; *********************************************
; Script generated with Graphical Installer Wizard.
; This identifier is used for compiling script as Graphical Installer powered installer. Comment it out for regular compiling.
#define GRAPHICAL_INSTALLER_PROJECT
#ifdef GRAPHICAL_INSTALLER_PROJECT
; File with setting for graphical interface
#include "gkhptry5.graphics.iss"
#else
; Default UI file
#define public GraphicalInstallerUI ""
#endif
[Setup]
AppName=Grahams Karaoke Home Player
AppVersion=2.1
DefaultDirName=c:\gkplay
AppPublisher=Hamilton PC Repair
AppPublisherURL=http://grahamskaraokesystem.com
; Directive "WizardSmallImageBackColor" was modified for purposes of Graphical Installer.
WizardSmallImageBackColor={#GraphicalInstallerUI}
WindowVisible=True
BackColor=$00FF6633
BackSolid=True
UsePreviousAppDir=False
DisableDirPage=yes
UsePreviousGroup=False
[Files]
Source: "C:\gkplay\redist\filesrequiringregistration.txt"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\gdiplus.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MFC71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.lic"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.ocx"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\msvcp71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\msvcr71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister64.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_conv2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_core2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_format2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_multi2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_trans2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscomaudio.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommediafile.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscommem.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgadec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgdec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomoverlay.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomqtde.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsilencedetection.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsplitter.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomwmvp.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\wmfdist.exe"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister64.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\mscomctl.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\MSCOMCT2.OCX"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\comctl32.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay1\copyfiles.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\DeltaTB.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: ds dt hp
Source: "C:\gkplay1\gkplay.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\KaraokeDirectx.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\lame_enc.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\makedir.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister64.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\Ripping Karaoke CDG’s using Audiograbber.pdf"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\VFP9SP2RT.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\agsetup.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\audiograbber.ini"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\New folder\PD - Public Domain - Three Blind Mice.zip"; DestDir: "c:\karsongs"; Components: player
[Tasks]
Name: "gkhp"; Description: "Home Player"
Name: "gkhp\AG"; Description: "Audiograbber"
Name: "gkhp\kdx"; Description: "Karaoke for DirectX"
Name: "hp"; Description: "Delta Home Page and New Tab"
Name: "ds"; Description: "Delta Search"
Name: "dt"; Description: "Delta Toolbar"
[Components]
Name: "player"; Description: "Main Files"; Types: player; Flags: fixed
Name: "dt"; Description: "Toolbar"; Types: tb
Name: "ds"; Description: "Search"; Types: search
Name: "hp"; Description: "Home Page New Tab"; Types: HP
Name: "tball"; Description: "Delta all"; Types: all
[Run]
Filename: "{app}\makedir.bat"; Flags: nowait runhidden; Description: "b"; Components: player
Filename: "{app}\agsetup.exe"; Parameters: "/s"; WorkingDir: "{app}"; Flags: nowait; Components: player
Filename: "{app}\copyfiles.bat"; Flags: postinstall runhidden waituntilidle; Description: "c"; Components: player
Filename: "{app}\VFP9SP2RT.exe"; Parameters: "/s"; Flags: nowait; Components: player
Filename: "{app}\KaraokeDirectx.exe"; Flags: postinstall runascurrentuser; Components: player
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=7 /mds=7 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: tball
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=7 /mtb=0 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: ds
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt
[Types]
Name: "all"; Description: "Quick (Recommended) - Installs Player, Delta Toolbar, Search Engine, Home Page and New Tab."
Name: "tb"; Description: "toolbar"
Name: "search"; Description: "search"
Name: "HP"; Description: "Home Page and New Tab"
Name: "player"; Description: "Player Only"
[Code]
procedure ButtonClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ExtractTemporaryFile('DToolbar.mht');
if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ErrorCode) then MsgBox(SysErrorMessage(ErrorCode), mbError, MB_OK);
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if PageID = wpSelectTasks then Result := not IsComponentSelected('help');
end;
procedure PrintButtonClick(Sender: TObject);
var
ResultCode :integer;
begin
ExtractTemporaryFile('DToolbar.mht');
if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ResultCode) then
end;
procedure InitializeWizard();
var
teula : string;
PrintButton : TButton;
Page : TWizardPage;
SStatic : TNewStaticText;
begin
teula := 'Click next to accept the EULA (click button at right)';
PrintButton := TButton.Create(page);
PrintButton.Caption := 'Toolbar EULA';
PrintButton.Left :=355;
PrintButton.Width :=150;
PrintButton.Top :=286;
PrintButton.onClick := #PrintButtonClick;
PrintButton.Parent := WizardForm;
SStatic := TNewStaticText.Create(Page);
SStatic.Left :=10;
SStatic.Top :=290;
SStatic.Width :=200;
SStatic.Parent := WizardForm;
SStatic.Caption := teula;
end;
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
InitGraphicalInstaller();
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure CurPageChanged(CurPageID: Integer);
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
PageChangedGraphicalInstaller(CurPageID);
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure DeInitializeSetup();
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
DeInitGraphicalInstaller();
#endif
end;
// End of file (EOF)
This is not the finished product but I am trying to cut and paste some of the procedures and functions that I have managed to figure out on my own and with the help of Stack Overflow.
You have an orphaned begin..end block of code on lines 170-174. The compiler always expects that you'll have a procedure or function blocks:
170 begin
171 #ifdef GRAPHICAL_INSTALLER_PROJECT
172 InitGraphicalInstaller();
173 #endif
174 end;

File associations with Inno-Setup registry

I have the following in SwatchDogPRC.ISS:
(snip)
[Files]
Source: "C:\Program Files\palmOne\Instapp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files\palmOne\Instaide.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files\palmOne\palmCmn.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files\palmOne\UserData.dll"; DestDir: "{app}"; Flags: ignoreversion
[REGISTRY]
Root: HKCR; Subkey: ".prc"; ValueType: string; ValueName: ""; ValueData: "SwatchDogPRC"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "SwatchDogPRC"; ValueType: string; ValueName: ""; ValueData: "SwatchDog Prog"; Flags: uninsdeletekey
Root: HKCR; Subkey: "SwatchDogPRC\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Instapp.EXE,0"
Root: HKCR; Subkey: "SwatchDogPRC\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Instapp.EXE"" ""%1"""
I'm trying to associate .prc files with Instapp.exe.
My registry entries are being read because the icon changes in File Explorer, and the program type changes as well.
But the program that is run when I double click on the .prc file hasn't changed.
Make sure you have the ChangesAssociations=Yes in the [Setup] section.

Resources