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);