Simplified install - MY SOLUTION



  • Hey guys! You helped me a lot as I had questions on my HISE journey and there's something I'd like to share with you:

    THE PROBLEM
    One of the most confusing (read: support-email-generating) things about HISE is the sample folder location. Unlike Kontakt, it doesn't look into subfolders. Plus, since HISE exports the plugins as standard formats, chances are, some people who'd get the instruments might not have had any previous experience with samples or Kontakt and would be surprised that after they've installed the plugin, things don't work right away.

    SO...
    I wrote a script (ok, two in fact - one is for Mac, the other for Windows) that solves this by auto-generating the link file and placing in the correct folder. When the user runs the installer, there's an option to locate the samples automatically. There's only one requirement for this to work - the samples need to be distributed along with the installer. I'm using Pulse to simplify the download process and it's perfect for that. The most recent versions added update functionality so if a new version of the plugin is out, it will be downloaded into the samples folder and auto-run. I'm sure there are other solutions out there but it's just something that I'm using.

    HOW TO: MAC
    Create a text file with .sh extension (so for example, yourinstrument_locatesamples.sh) and set it as a post-install script in Whitebox Packages. I'm using it as a separate component named locate samples so that the user has an option to have it selected or not.

    Here's the script:

    #!/bin/sh
    
    instrumentname="Blisko Cello"
    devname="Felt Instruments"
    
    FILE="$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX"
    if test -n "$FILE"; then
    		rm -R "$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX"
    
    fi
    
    installer="${instrumentname}".pkg
    mystring=$1
    echo basename: $(basename "${mystring}")
    echo basename + remove "${installer}": $(basename "${mystring}" "${installer}")
    sudo echo -n $(dirname "${mystring}") > "$HOME/Library/Application Support/${devname}/${instrumentname}/LinkOSX"
    
    
    exit 0
    

    You only have to adapt the first two lines - instrumentname and devname. Export the installer as instrumentname.pkg and you should be fine.

    HOW TO: WINDOWS
    I'm using innosetup on Windows. Here's the whole script:

    [Setup]
    
    #define AppName "Blisko Cello"
    #define AppVersion "1.1.2"
    #define DevDir "Felt Instruments"
    PrivilegesRequired=admin
    AppName={#AppName}
    AppVersion={#AppVersion}
    SignTool=signtool
    SignedUninstaller=yes
    
    DefaultDirName={pf}\{#DevDir}\{#AppName}
    DefaultGroupName={#AppName}
    Compression=lzma2
    SolidCompression=yes
    OutputDir=.\installerbuild
    ArchitecturesInstallIn64BitMode=x64
    OutputBaseFilename={#AppName}
    LicenseFile=".\installerAssets\EULA.rtf"
    WizardSmallImageFile=".\installerAssets\install_logo.bmp"
    
    
    
    ; BANNER
    WizardImageFile=".\installerAssets\banner_blisko_cello.bmp"
    SetupIconFile=".\installerAssets\windows_icon.ico"
    DisableWelcomePage=no
    DisableDirPage=yes
    DisableProgramGroupPage=yes
    
    
    SetupLogging=yes
    ChangesAssociations=no
    
    [Types]
    Name: "full"; Description: "Full installation"
    Name: "custom"; Description: "Custom installation"; Flags: iscustom
    
    [Dirs]
    Name: "{app}\"; Permissions: users-modify powerusers-modify admins-modify system-modify
    
    [Components]
    Name: "vst2_32"; Description: "{#AppName} {#AppVersion} 32-bit VST Plugin"; Types: full custom;
    Name: "vst2_64"; Description: "{#AppName} {#AppVersion} 64-bit VST Plugin"; Types: full custom; Check: Is64BitInstallMode; 
    Name: "aax"; Description: "{#AppName} {#AppVersion} AAX Plugin"; Types: full custom; Check: Is64BitInstallMode;
    Name: "locatesamples"; Description: "Locate samples (recommended!)"; Types: full custom;
    
    
    
    
    
    [Files]
    
    ; VST
    Source: "{#AppName} x86.dll"; DestDir: "{code:GetVST2Dir_32}"; Flags: ignoreversion; Components: vst2_32; Check: not Is64BitInstallMode
    
    Source: "{#AppName} x86.dll"; DestDir: "{code:GetVST2Dir_32}\{#DevDir}"; Flags: ignoreversion; Components: vst2_32; Check: Is64BitInstallMode
    Source: "{#AppName} x64.dll"; DestDir: "{code:GetVST2Dir_64}\{#DevDir}"; Flags: ignoreversion; Components: vst2_64; Check: Is64BitInstallMode
    
    ;BEGIN_AAX
    Source: "{#AppName}.aaxplugin\*"; DestDir: "{commonpf}\Common Files\Avid\Audio\Plug-Ins\{#AppName}.aaxplugin"; Flags:ignoreversion createallsubdirs recursesubdirs overwritereadonly; Components: aax
    ;END_AAX
    
    ; PRESETS
    Source: "{#AppName} UserPresets\*"; DestDir: "{userappdata}\{#DevDir}\{#AppName}\User Presets"; Flags: ignoreversion recursesubdirs;
    
    
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
    
    
    
    
    
    
    
    
    
    
    [Icons]
    Name: "{group}\Uninstall {#AppName}"; Filename: "{app}\Uninstall{#AppName}.exe"    
    
    [Code]
    var
      OkToCopyLog : Boolean;
      VST2DirPage_32: TInputDirWizardPage;
      VST2DirPage_64: TInputDirWizardPage;
      SamplesDirPage: TInputDirWizardPage;
      SampleLocation: String;
      AppDataFolder: String;
    
    
    function SampleFolderLocated(): boolean;
    begin
      result := FileExists(ExpandConstant('{userappdata}\{#DevDir}\{#AppName}\LinkWindows')) and (not IsComponentSelected('locatesamples'));
    end;
    
    
    procedure InitializeWizard;
    
    begin
    
      if IsWin64 then begin
        VST2DirPage_64 := CreateInputDirPage(wpSelectDir,
        'Confirm 64-Bit VST2 Plugin Directory', '',
        'Select the folder in which setup should install the 64-bit VST2 Plugin(you can choose not to install this version later),  then click Next.',
        False, '');
        VST2DirPage_64.Add('');
        VST2DirPage_64.Values[0] := ExpandConstant('{reg:HKLM\SOFTWARE\VST,VSTPluginsPath|{pf}\Steinberg\VSTPlugins}\');
    
        VST2DirPage_32 := CreateInputDirPage(wpSelectDir,
          'Confirm 32-Bit VST2 Plugin Directory', '',
          'Select the folder in which setup should install the 32-bit VST2 Plugin(you can choose not to install this version later), then click Next.',
          False, '');
        VST2DirPage_32.Add('');
        VST2DirPage_32.Values[0] := ExpandConstant('{reg:HKLM\SOFTWARE\WOW6432NODE\VST,VSTPluginsPath|{pf32}\Steinberg\VSTPlugins}\');
    
      end else begin
        VST2DirPage_32 := CreateInputDirPage(wpSelectDir,
          'Confirm 32-Bit VST2 Plugin Directory', '',
          'Select the folder in which setup should install the 32-bit VST2 Plugin,  then click Next.',
          False, '');
        VST2DirPage_32.Add('');
        VST2DirPage_32.Values[0] := ExpandConstant('{reg:HKLM\SOFTWARE\VST,VSTPluginsPath|{pf}\Steinberg\VSTPlugins}\');
      end;
    end;
    
    function GetVST2Dir_32(Param: String): String;
    begin
      Result := VST2DirPage_32.Values[0]
    end;
    
    function GetVST2Dir_64(Param: String): String;
    begin
      Result := VST2DirPage_64.Values[0]
    end;
    
    function GetSamplesDir(Param: String): String;
    begin
      Result := SamplesDirPage.Values[0]
    end;
    
    procedure CurStepChanged(CurStep: TSetupStep);
    
    
    
    begin
      if CurStep = ssDone then
        OkToCopyLog := True;
    
        if not SampleFolderLocated() then begin
        SampleLocation := ExpandConstant('{src}');
        AppDataFolder := ExpandConstant('{userappdata}\{#DevDir}\{#AppName}\LinkWindows');
        SaveStringToFile(AppDataFolder, SampleLocation, False);
        end else
    end;
    
    procedure DeinitializeSetup();
    
    begin
      if OkToCopyLog then
        FileCopy (ExpandConstant ('{log}'), ExpandConstant ('{app}\InstallationLogFile.log'), FALSE);
      RestartReplace (ExpandConstant ('{log}'), '');
    end;
    
    [UninstallDelete]
    Type: files; Name: "{app}\InstallationLogFile.log"
    

    What you need to edit is the first block and the banner .bmp file if you're using that.

    That's all folks. Hopefully it will be useful to some of you!



  • @tomekslesicki Awesome, I've been toying around with solutions like this too, but this looks like a great launch point!



  • this is great! But how does it know where Mac users put the Sample folder? or are they supposed to move it PRE installation?


Log in to reply
 

26
Online

956
Users

3.4k
Topics

28.9k
Posts