I have a web app which gets deployed locally with my installer which I have learned I need to run a few commands OR reboot the system afterwards to get the website working correctly otherwise a get a 502.5 server error. I have learned I can manually resolve the error by running the following commands: "net stop was /y" followed by "net start w3svc". As I stated, if the PC reboots, there is no need to run these commands.
The software which is installing will commonly be installed on a server and it'd be convenient for the user to not require a reboot after my application has finished installing, therefore I'd prefer not to prompt the user to reboot. I attempted to make a custom action using the "Run PowerShell inline script" option, but it does not seem to execute the script correctly as I get the 502.5 server error immediately after installation. Running the commands mentioned previously in an elevated command prompt causes the website to work as it should.
Something else to note is that I do have the installer configured in the "Install Parameters" area with the "Run as administrator" box checked. Is there something I can do to either debug the script, force the script to run in admin mode, or if there is a way to do this built into Advanced Installer that doesn't force me to manually run this script, that'd be great.