Removing the Context Menus after install the package - Advanced Installer Community
mindsleader
Posts: 1
Joined: Tue Jun 20, 2023 2:03 pm

Removing the Context Menus after install the package

hello there,
I am building an installer for an MSI file and I want to install it as a package without any modification by placing the package in the post-install within the prerequest page, but after installing the package the application shortcuts appear in the Context Menus and I do not want that! , and I like the package to be installed and then I need to delete The registry keys responsible for creating shortcuts in the Context Menus, so I tried to add custom actions and add a new value removel (in the registry page), to delete the registry keys in:
HKEY_CLASSES_ROOT\Directory\shell\AAA
HKEY_CLASSES_ROOT\Directory\background\shell\AAA
HKEY_CLASSES_ROOT\Drive\shell\AAA
HKEY_CLASSES_ROOT\*\shell\ AAA
But all my attempts failed, as I tried to run "PowerShell Inline Script" in the following way:

Code: Select all

New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT 
Remove-Item -Path HKCR\Directory\shell\AAA,HKCR\Directory\background\shell\SentinelOneScan,HKCR\Drive\shell\AAA,HKCR\*\shell\AAA -Force -Verbose
This didn't work either,
So I created an "Execute Inline Script code" with the Visual Basic Script VBA type with the following values:

Code: Select all

Dim WshShell, cal1
Set WshShell = WScript.CreateObject("WScript.Shell")
cal1 = "HKEY_CLASSES_ROOT\Directory\shell\SentinelOneScan\"
WshShell. RegDelete cal1
cal1 = "HKEY_CLASSES_ROOT\Directory\background\shell\SentinelOneScan\"
WshShell. RegDelete cal1
cal1 = "HKEY_CLASSES_ROOT\Drive\shell\SentinelOneScan\"
WshShell. RegDelete cal1
cal1 = "HKEY_CLASSES_ROOT\*\shell\SentinelOneScan\"
WshShell. RegDelete cal1
But that also didn't work!
So,Can you help me solve this problem?? Thank you all :)
Liviu
Posts: 1419
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Removing the Context Menus after install the package

Hello and welcome to our forums,

I'm not quite sure I fully understand this.

Do you have an installation package (added as a prerequisite in your project) that is not created by you that creates a context menu entry?

Can you please give me more details about this and also send us the .AIP (setup project) file by email to support at advancedinstaller dot com so we can further test and investigate this?

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”