Hello Lars,
Can you please tell me exactly what actions Advanced Installer is trying to perform when "Enable UPnP service" is checked
Sure. In a newly created project (dummy project), if you go to
"Windows Firewall" page -->
"Options" page and enable any of the options there, the following action is added in the
"Table Editor" page -->
"Install Execute Sequence" table:
AI_FwInstall
If you order the actions by their sequence, you can notice that this custom action is scheduled during the deferred action stage (when the system is being modified) and between the
"InstallServices" and
"StartServices" actions.
As discussed above, by manually enabling that option in the
"Windows Firewall" page, all that happens is that the
"Network Discovery (UPnP-In)" inbound rule is enabled
for the Private profile.
Basically, what we need to do here is to enable that inbound rule
for the Private profile.
and how to do the same in VBS
Unfortunately, I am not very experienced in what regards VBS. I can, however, help you with a little PowerShell script which does just that:
Code: Select all
Get-NetFirewallRule | Where {$_.DisplayName -eq "Network Discovery (UPnP-In)" -and $_.Profile -like "*Private*"} | Enable-NetFirewallRule
The above PowerShell script will enable the inbound rule we've previously discussed.
Here is how you can implement that in Advanced Installer:
1. first, you need to disable the option from the
"Windows Firewall" page
2. now please go to
"Custom Actions" page and add a
"Run PowerShell inline script" custom action,
with sequence (simply press the
"Add custom action with sequence" button which is placed to the right side of the custom action's name).
3. copy paste the code from above. Additionally, set the execution time to
"When the system is being modified (deferred)" and also check the
"Run under the LocalSystem account with full privileges (no impersonation)" option. Optionally, you can set this action to execute only during Install by unchecking the "Uninstall" and "Maintenance" options from under the
"Execution Stage Condition" section.
4. now please right click on any action group from the
"Install Execution Stage" -->
"Show Standard Action" -->
"Add Resources" --> select
"InstallServices"
5. please repeat the above step, but now select the
"StartServices" action
6. now please schedule your custom action between the two actions mentioned above. To do so, simply drag and drop it.
7. in the end, your custom action should look something similar to this.
- PS.png (163.2 KiB) Viewed 21297 times
Hope this helps.
Best regards,
Catalin