Hello and welcome to Advanced Installer forums Madhav,
but it is working fine with the installation
I'm not sure I fully understand your scenario. Do you mean to say that the sql script is executed properly during the installation of the upgraded version but the script is not executed during the patch installation?
Please keep in mind that in order to run a custom action or a sql script during installation you need to add the
PATCH string in the
Condition field. For details, please see the
How to create a patch that runs a custom action article.
In order to have a better view about this, can you please send us the .AIP(project file) of target, .AIP(project file) of upgraded and the .AIP(project file) of patch project to
support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behavior.
When a patch is installed, the base MSI will run in
Repair mode. That means you need to select the
During maintenance (repair or modify) option for the sql script execution. Use the below image for your reference:

- Script Patch.png (29.93 KiB) Viewed 3856 times
Also, I observed several WARNINGs in the build log with the file sequence changed. Usually, these warnings are displayed when you removed some files or if you are using the
Synchronize Folder feature. When creating patches you should make sure they don't break the
patch rules.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging