I'm trying to run a program after my install finishes. I've defined it this way:
[Files]
; Post install
Source: "UpdateSettingsFile\*.exe"; DestDir: {tmp}
Source: "UpdateSettingsFile\*.dll"; DestDir: {tmp}
Source: "UpdateSettingsFile\UpdateSettingsFile.runtimeconfig.json"; DestDir: {tmp}
Source: "UpdateSettingsFile\*.json"; DestDir: {tmp}
[Run]
Filename: "{tmp}\UpdateSettingsFile.exe"; \
Description: "Post Install Update Settings File"; \
Flags: nowait postinstall skipifsilent
The UpdateSettingsFile
does start at the end of the install. However, it fails with the following error:
Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4febb2abaeed'. The system cannot find the file specified.
The Newtonsoft.Json.dll
is in the same folder as the files in the [Files]
section and should be found.
I don't understand why this fails. My intent is to run a program after the install and remove it when finished.
I'd guess that the nowait
flag is the problem. After the installer starts the .exe, the installer finishes and deletes the .dlls. Remove the flag to make the installer wait for the .exe before finishing and removing the .dlls.
Overall, I'd remove all three flags. Don't you want to update the settings unconditionally?