Automatic Installer for Windows: Inno Setup Script
-
Hello!
I thought that maybe for some this Inno Setup script could be useful. It installs the plugin + samples automatically on the user's computer.
It does the following:
- Asks the user where they have their VST3 plugins folder. {commoncf}\VST3 is selected by default, but the user can change it.
- It then asks where you want to install the samples.
- And finally it creates the LinkWindows file with the chosen location of the samples.
(In this case I also added the file "AudioResources.dat" so that it is automatically installed in the userappdata folder)
In this way, the user simply opens the plugin and already has everything configured.
Paying attention to the * symbol at the end of the source file location because it includes the folders inside the selected folder. For example, inside the "D:\Downtown Grand Piano\Samples Folder*" location I have the folder called Downtown Grand Piano Samples. Inno Setup will include the folder inside “Samples Folder”, which is "Downtown Grand Piano Samples" (You can check the Inno Setup documentation if you need to understand this better.)
Then the linkWindows file is autogenerated with the location chosen by the user + \Downtown Grand Piano Samples at the end.(I received help from GPT to automatically generate the linkWindows file, although it took me some time to make it work properly)
[Files] Source: "D:\Downtown Grand Piano\AudioResources.dat"; DestDir: "{userappdata}\ZAK Sound\Downtown Grand Piano"; Source: "D:\Downtown Grand Piano\VST3 File\*"; DestDir: "{code:GetVst3Directory}"; Flags: recursesubdirs Source: "D:\Downtown Grand Piano\Samples Folder\*"; DestDir: "{code:GetSampleDirectory}"; Flags: recursesubdirs createallsubdirs [Code] var Vst3DirectoryPage: TInputDirWizardPage; SampleDirectoryPage: TInputDirWizardPage; procedure InitializeWizard; begin SampleDirectoryPage := CreateInputDirPage(wpSelectDir, 'Select Samples Directory', 'Where would you like to install the samples?', 'Select the location where you want to install the samples (2.58GB). You can use an external drive if you have one.', False, ''); SampleDirectoryPage.Add(''); SampleDirectoryPage.Values[0] := ExpandConstant('{commoncf}\VST3\Downtown Grand Piano'); Vst3DirectoryPage := CreateInputDirPage(wpSelectDir, 'Select VST3 Directory', 'Where would you like to install the VST3 file?', 'Select the default location of your VST3 plugins. In most cases, there is no need to make any changes.', False, 'Size: 29MB'); Vst3DirectoryPage.Add(''); Vst3DirectoryPage.Values[0] := ExpandConstant('{commoncf}\VST3'); end; function GetVst3Directory(Param: String): String; begin Result := Vst3DirectoryPage.Values[0]; end; function GetSampleDirectory(Param: String): String; begin Result := SampleDirectoryPage.Values[0]; end; procedure CurStepChanged(CurStep: TSetupStep); var LinkWindowsFilePath: string; LinkWindowsFileContent: string; SampleDirectory: string; BaseDirectory: string; begin if CurStep = ssInstall then begin BaseDirectory := ExpandConstant('{userappdata}\ZAK Sound\Downtown Grand Piano'); ForceDirectories(BaseDirectory); LinkWindowsFilePath := BaseDirectory + '\LinkWindows'; if FileExists(LinkWindowsFilePath) then DeleteFile(LinkWindowsFilePath); SampleDirectory := GetSampleDirectory(''); LinkWindowsFileContent := SampleDirectory + '\Downtown Grand Piano Samples'; SaveStringToFile(LinkWindowsFilePath, LinkWindowsFileContent, False);
-
@bendurso Thanks! That looks soo cool!! Can this be applied also for mac? Using packages for instance?
-
@Sawer No InnoSetup is PC only
-
@Sawer Packages doesn't allow the user to select the installation folder (as far as I know)
-
@bendurso Ok, will dig into that. In any case thanks so much for the InnoSetup Version.
-
This is super helpful! I implemented this with one of my projects and was able to have the installer place the samples in the desired location. When I open the VST, the samples are not connected.
Is this automatic connection associated to the "AudioResources.dat" that is not included? Or is it something else?
Thank you for your help
-
@obolig The link of the plugin with the samples folder is made by the "LinkWindows" file inside {userappdata}\Your Brand\Your Plugin. This script creates that file.
When the user selects the directory, the scripts creates the file with this text location + "/Plugin Samples" (in my case /Downtown Grand Piano Samples).
Check the LinkWindows file created by the script (after running the installer) and you should find if there's some error.
-
@bendurso Thank You! This helped me resolve the issue. I wrote the prompt for the LinkWindows file to look inside of the samples folder instead of the samples folder itself. Everything is working great now.