Return to site

Inno setup check if already installed

broken image
broken image

MsgBox('Just installed ' + FileName + ' as ' + CurrentFileName + '. Procedure MyAfterInstall2(FileName: String)

broken image

MsgBox('Just installed MyProg.exe as ' + CurrentFileName + '.', mbInformation, MB_OK) MsgBox('About to install ' + FileName + ' as ' + CurrentFileName + '.', mbInformation, MB_OK)

broken image

Procedure MyBeforeInstall2(FileName: String) MsgBox('About to install MyProg.exe as ' + CurrentFileName + '.', mbInformation, MB_OK) Functions CurrentFileName and Log are support functions and therefore not included in this section. Here is an example of a section containing the functions used above.

If you uninstall the application and run Setup again, it will use the new DefaultDirName setting. Use CurrentFileName to check for which file the function is called. At startup Setup looks in the registry to see if the same application was already installed previously, and if so, it will use the directory of the previous installation as the default directory presented to the user in the wizard. Source: 'MYPROG.EXE' DestDir: '' AfterInstall: Log('After MYPROG.CHM Install')Īll BeforeInstall and AfterInstall functions must not have a return value.Ī BeforeInstall or AfterInstall function isn't called if Setup already determined the entry it shouldn't be processed.Ī BeforeInstall or AfterInstall function for a section entry using a wildcard is called once per file matching the wildcard.