Login / Register 0 items | $0.00 New @ KVR
User avatar
discoDSP
KVRAF
 
3511 posts since 17 Jul, 2002

Postby discoDSP; Thu Mar 15, 2018 2:10 am Inno Setup installer script example with VST2 path support

I have been working on new Inno installers and I would like to share the script. Basically it's a enhanced version of Oli Larkin one including better VST2 folder selection dialog as well as VST3 support. Keep making great plugins! :)

https://www.discodsp.com/public/discoverypro.iss.zip

Code: Select all
#define AppVer "6.6"
#define BuildOut "DiscoveryProR66Demo"

[Setup]
DisableDirPage=yes
ArchitecturesInstallIn64BitMode=x64
AppName=discoDSP Discovery Pro {#AppVer} Demo
AppPublisherURL=https://www.discodsp.com/
AppSupportURL=https://www.discodsp.com/contact/
AppUpdatesURL=https://www.discodsp.com/members/
AppVerName=discoDSP Discovery Pro Demo
AppVersion={#AppVer}
Compression=lzma2/ultra64
DefaultDirName={pf}\discoDSP\
DefaultGroupName=discoDSP
DisableReadyPage=true
DisableWelcomePage=yes
LanguageDetectionMethod=uilanguage
LicenseFile=license_demo.txt
OutputBaseFilename={#BuildOut}
SetupIconFile=setup.ico
ShowLanguageDialog=no
VersionInfoCompany=discoDSP
VersionInfoCopyright=discoDSP
VersionInfoDescription=discoDSP Discovery Pro {#AppVer} Demo
VersionInfoProductName=Discovery Pro
VersionInfoProductVersion={#AppVer}
VersionInfoVersion={#AppVer}
WizardImageFile=WizModernImage.bmp
WizardImageStretch=false
WizardSmallImageFile=WizSmall.bmp

[Files]
Source: "discoDSP\Discovery Pro\*.*"; DestDir: "{userdocs}\discoDSP\Discovery Pro\"; Flags: recursesubdirs onlyifdoesntexist
Source: "Demo64\DiscoveryPro64.dll"; DestDir: {code:GetVST2Dir|0}; Components: VST64; Flags: ignoreversion
Source: "Demo32\DiscoveryPro.dll"; DestDir: {code:GetVST2Dir|1}; Components: VST; Flags: ignoreversion
Source: "Demo64\DiscoveryPro64.vst3"; DestDir: "{cf64}\VST3\"; Components: VST364; Flags: ignoreversion
Source: "Demo32\DiscoveryPro.vst3"; DestDir: "{cf32}\VST3\"; Components: VST3; Flags: ignoreversion

[Icons]
Name: {group}\Discovery Pro PDF Users Manual; Filename: {userdocs}\discoDSP\Discovery Pro\Help\Discovery Pro Users Manual.pdf; Flags: runmaximized
Name: {group}\Uninstall Discovery Pro {#AppVer} Demo; Filename: {uninstallexe}

[Run]
Filename: "{userdocs}\discoDSP\Discovery Pro\Help\Discovery Pro Users Manual.pdf"; WorkingDir: "{userdocs}\discoDSP\Discovery Pro\Help\"; Description: "Open PDF Users Manual"; Flags: shellexec postinstall nowait

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Types]
;Name: "full"; Description: "{code:FullInstall}";
Name: "custom"; Description: "{code:CustomInstall}"; Flags: iscustom

[Components]
Name: "VST364"; Description: "64-bit VST3"; Types: custom; Check: Is64BitInstallMode
Name: "VST64"; Description: "64-bit VST2"; Types: custom; Check: Is64BitInstallMode
Name: "VST3"; Description: "32-bit VST3"; Types: custom;
Name: "VST"; Description: "32-bit VST2"; Types: custom;


[Code]
var
  VST2DirPage: TInputDirWizardPage;
  TypesComboOnChangePrev: TNotifyEvent;

procedure ComponentsListCheckChanges;
begin
  WizardForm.NextButton.Enabled := (WizardSelectedComponents(False) <> '');
end;

procedure ComponentsListClickCheck(Sender: TObject);
begin
  ComponentsListCheckChanges;
end;

procedure TypesComboOnChange(Sender: TObject);
begin
  TypesComboOnChangePrev(Sender);
  ComponentsListCheckChanges;
end;

procedure InitializeWizard;
begin

  WizardForm.ComponentsList.OnClickCheck := @ComponentsListClickCheck;
  TypesComboOnChangePrev := WizardForm.TypesCombo.OnChange;
  WizardForm.TypesCombo.OnChange := @TypesComboOnChange;

  VST2DirPage := CreateInputDirPage(wpSelectComponents,
  'Confirm VST2 Plugin Directory', '',
  'Select the folder in which setup should install the VST2 Plugin, then click Next.',
  False, '');

  VST2DirPage.Add('64-bit folder');
  VST2DirPage.Values[0] := GetPreviousData('VST64', ExpandConstant('{reg:HKLM\SOFTWARE\VST,VSTPluginsPath|{pf}\Steinberg\VSTPlugins}\discoDSP'));
  VST2DirPage.Add('32-bit folder');
  VST2DirPage.Values[1] := GetPreviousData('VST32', ExpandConstant('{reg:HKLM\SOFTWARE\WOW6432NODE\VST,VSTPluginsPath|{pf32}\Steinberg\VSTPlugins}\discoDSP'));

  If not Is64BitInstallMode then
  begin
    VST2DirPage.Values[1] := GetPreviousData('VST32', ExpandConstant('{reg:HKLM\SOFTWARE\VSTPluginsPath\VST,VSTPluginsPath|{pf}\Steinberg\VSTPlugins}\discoDSP'));
    VST2DirPage.Buttons[0].Enabled := False;
    VST2DirPage.PromptLabels[0].Enabled := VST2DirPage.Buttons[0].Enabled;
    VST2DirPage.Edits[0].Enabled := VST2DirPage.Buttons[0].Enabled;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = VST2DirPage.ID then
  begin
    VST2DirPage.Buttons[0].Enabled := IsComponentSelected('VST64');
    VST2DirPage.PromptLabels[0].Enabled := VST2DirPage.Buttons[0].Enabled;
    VST2DirPage.Edits[0].Enabled := VST2DirPage.Buttons[0].Enabled;

    VST2DirPage.Buttons[1].Enabled := IsComponentSelected('VST');
    VST2DirPage.PromptLabels[1].Enabled := VST2DirPage.Buttons[1].Enabled;
    VST2DirPage.Edits[1].Enabled := VST2DirPage.Buttons[1].Enabled;
  end;

  if CurPageID = wpSelectComponents then
  begin
    ComponentsListCheckChanges;
  end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if PageID = VST2DirPage.ID then
  begin
    If (not IsComponentSelected('VST')) and (not IsComponentSelected('VST64'))then
      begin
        Result := True
      end;
  end;
end;

function GetVST2Dir(Param: string): string;
begin
    Result := VST2DirPage.Values[StrToInt(Param)];
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  SetPreviousData(PreviousDataKey, 'VST64', VST2DirPage.Values[0]);
  SetPreviousData(PreviousDataKey, 'VST32', VST2DirPage.Values[1]);
end;
discoDSP Plug-Ins | Synths | Sampler | Effects
wavesfactory
KVRist
 
296 posts since 12 May, 2010

Postby wavesfactory; Thu Mar 15, 2018 8:13 am Re: Inno Setup installer script example with VST2 path support

Thanks!
- Wavesfactory.
Audio Miracles.
https://www.wavesfactory.com
joshb
KVRist
 
69 posts since 13 Apr, 2016

Postby joshb; Sun May 06, 2018 5:27 pm Re: Inno Setup installer script example with VST2 path support

Thank you for that Inno script. Nice stuff.

Are you getting the VST2 paths restored on subsequent installs? I am on 64 bit but not on 32 bit for some reason. I admit to making some minor changes to your script, but I really don't think that's it.

Thoughts?
User avatar
discoDSP
KVRAF
 
3511 posts since 17 Jul, 2002

Postby discoDSP; Sun May 06, 2018 11:23 pm Re: Inno Setup installer script example with VST2 path support

You're welcome :) The installer should remember installed plugin path and components but won't modify the original location because it's registry based and I decided not to mess with it. Feel free to post your script modifications :)
discoDSP Plug-Ins | Synths | Sampler | Effects

Moderator: Moderators (Main)

Return to DSP and Plug-in Development