SyMenu Forum

SyMenu

 

HomeSyMenu Plugins

Everything related to SyMenu plugins: discussion, development, documentation and release

A little help would be nice Messages in this topic - RSS

jagg3127
jagg3127
Posts: 4


2 days ago
jagg3127
jagg3127
Posts: 4
I want to make a plugin and I dont know if theres a guide that im missing or what. The plugin idea I have is basically to detect when an app is downloaded. Get the path for it and not make the original shortcuts but make a different app shortcut plugging in all the info into it but making the app run a custom ahk script instead and pass its app install locations to it. If someone could help that would be great.
link
Gianluca
Gianluca
Administrator
Posts: 1304


1 days ago
Gianluca
Gianluca
Administrator
Posts: 1304
Hello jagg3127,
I'm not understanding well what you intended to do but I will try to reply the same. If you see I'm astray, please explain the problem better.

You can't mess up with the original "shortcuts" if you intend the shortcuts created in SyMenu.
If you install a package and remove/alter its shortcut, SyMenu will remove that program because it sees it not referenced anymore.
Anyway you can create a new shortcut for that same program and hide the original one. This is allowed.

Currently the plugin system has no events to track an installation but that's quite normal. When I built the plugin system I created only what I needed and what the users told me they needed.

I can create what you need but I would be convinced that a plugin is the right way to do what you intended to.
What I feel is that you can directly edit the configuration file for the items. This approach will be useful for new programs and old programs too.
But it's all hypothesis because, as I told you, I don't understand well what you intended to do.

Out of curiosity what your AutoHotkey script should do more than a direct execution does?
Because if it's a real game changer thing, you could find it implemented directly in SyMenu by me.
link
jagg3127
jagg3127
Posts: 4


1 days ago
jagg3127
jagg3127
Posts: 4
Basically it isn't exactly "my script"(basicallyit runs corresponding to an x86 or x64 file i eventually want to add arm support and the ability to detect if one is missing) but imma edit it a lot to add these features:
- if its x64 and their is no x64 file than it'll ask if you want to run the x86 file
- somehow detect if there is only 1 app or if theirs two x64 files and stuff like that, and give options when downloading which you would like to link or to pop up a menu telling you to select one
(as an example autoruns has x86, x64 and x64 cmd versions, or maybe something like Revo Uninstaller which has one launcher(Which should be handled as it is already)

Cause right now the system dumps the x86 and x64 files into the folder and it clutters it quite a lot. Let me just show you the script and an image of an app its probably easier to understand that way.




a little explanation, using HWMonitor as reference, first off it installed itself on the root of the System folder originally as 2 separate files which makes digging through files a pain so i put it in a folder which still is a pain cause this script kinda makes it a 1 click solved kinda situation. So i found this script(attached) that simplifies the process and just detects your system architecture and runs the file based off your system. I still need to tweak it to do more so what I'm doing but yeah.

I also set an advanced parameter to set the directory of the program for ease of use just cause doing it manually is a pain hence why i was going to use a plugin if possible. I like automating stuff as a programmer that is just what I do.

Manually having to merge these like I did for HWMonitor is slow and tedious hence why I was asking. (Also yes I know someone posted about this script on this forum already but I plan on adding a few extra features that'll just really make it work well, full shout out to this forum for the original script that I will be editing https://ugmfree.it/forum/messages.aspx?TopicID=345)

edited by jagg3127 on 21/02/2025

Attachments:
SyMenuRun32or64.ahk
link
Gianluca
Gianluca
Administrator
Posts: 1304


1 days ago
Gianluca
Gianluca
Administrator
Posts: 1304
Now it's a bit clearer.

I've got a question for you.
If you abandon the original script to rewrite it as a plugin (I imagine you know they are two different things, written with different languages, interacting with SyMenu in very different ways) so as to improve it, why do you need the notification on program installation???

Follow me.
You are asking to be notified whenever a new program is installed.
I imagine you want to use that event to analyze what has been installed to find if there are multiple exe. In that case you want to create a new item that becomes the only launcher. I imagine you think to hide all the other executables already created for that program to prevent any kind of confusion.
It's a huge job, a lot of interaction with SyMenu and a lot of menu structure manipulation.
I doubt you can realize a project so ambitious and not because I think you are not able to do that but because I know how big and complex these activities are under the SyMenu hood.

But what if the moment you analyze the program executable is not the installation but the program launch?
If you write a plugin and not a simple script, you have a lot of powerful tools to use and you'll be able to make a lot of considerations about this launched executable.
For example you can scan the exe folder to recognize similar executables located there inside.
You can even recognize if the launched exe is for the x64 or x86 platform and check the other file you found.
With some smart rules you can even trust the executable names to recognize their architecture.
Or even show everything you found in that folder to the user and leave a blind (for your code) choice to him.
This way the plugin will be instantly available for any program already configured and not only with the newly installed, it operates dynamically, you don't need to create a new item for every program to create the launcher because the launcher will be activated from every SyMenu item, you won't need to think about the cleaning up because when a program is uninstalled a physical item must be deleted too.
Plus creating the plugin the way I suggest it seems simpler to develop, but it's only my two cents.

What is it lacking in SyMenu?
Today the only event available close to the program launch moment is an event that notify the subscriber AFTER a program is launched.
So what it lacks is an event notifying the subscriber BEFORE a program is launched and that can block the launch waiting for the user choice.

Ok... Frankly I don't like this kind of interaction because it opens an awful security breach.
If a third party software can execute anything, maybe even in elevated mode, the users are completely unarmed.

Example:
- the user launch Autorun x86
- the plugin block the execution
- then it checks the folder to search for something else
- since it finds Autorun x86, x64, and CLI, it shows the user a selection between the three
- the user choose Autorun x64
- the plugin download a ransomware and execute it
- the user sees the elevation request by Windows and clicks Ok.
Done.

When that script appeared for the first time on this forum I studied it and it seemed non dangerous at all because it asked the user interaction to define the two exe paths.
So no problem at all.
An automation like the one you are thinking about is really difficult to control.


Anyway I'm open to any further suggestions.
link
jagg3127
jagg3127
Posts: 4


1 days ago
jagg3127
jagg3127
Posts: 4
I don't want the plugin to run every time you launch an application I want it to not even be able to install anything. All I want it to do is change the shortcuts defined originally just like I had shown. If there is a simpler way of doing this through plugins that would be optimal. What programming language is it written in? (I have actually never used ahk its just what i was handed and was gonna teach myself it on the spot cause its simplicity for what I was doing, manually. If it were automated it would be a lot cleaner and way better setup wise, would just take me a few days to port it to a plugin and figure out syntax and stuff.)


I don't even need a script notify on program installation to be honest the plugin could run right after its installed find the folder and change the paths. It would have no ability to download anything besides changing the configuration of your downloads to be automated.


Ok now I see what you mean by the plugin needing to run every time they clicked an app ok ok. So depending on the programming language we could have the plugin never ask for Admin and only the app you're running to be that cause if you run it you could probably have the app ask for admin so the plugin would never be able to download stuff. Yeah I see the concerns of security but its still a good idea for my use case even if its a plugin only me and some close friends use then I would still want to know how top make a plugin and which programming language it would be in.
link
jagg3127
jagg3127
Posts: 4


5 hours ago
jagg3127
jagg3127
Posts: 4
Ok I figured out, after some debugging of the two plugins I had, my issue is that I need to know what csproj file your using because I cannot figure out how to import the Libs directory into the dll. Or just inform me how, I could probably figure out the rest.
link
Gianluca
Gianluca
Administrator
Posts: 1304


5 hours ago
Gianluca
Gianluca
Administrator
Posts: 1304
jagg3127 wrote:
I don't want the plugin to run every time you launch an application I want it to not even be able to install anything. All I want it to do is change the shortcuts defined originally just like I had shown. If there is a simpler way of doing this through plugins that would be optimal.

It's not the way a plugin is intended to work. A plugin system is not an open door to do whatever the plugin wants.
The main program offers an interface through which you can interact with it. So it's the main program deciding what a plugin can do, not vice versa.
Ideally every portion of a program can be funneled through a plugin interface but unfortunately for your idea the SyMenu plugin system doesn't offer any method to interact with the item structure.
The SyMenu plugin system is at a germinal status because the needs emerged in the past were very few.
You are asking for a new need but IMHO it's too dangerous to open that door as I explained before. And not because I don't trust you but because once I open that door, it's opened for everyone.

jagg3127 wrote:
What programming language is it written in?

.NET Core


jagg3127 wrote:
I don't even need a script notify on program installation to be honest the plugin could run right after its installed find the folder and change the paths. It would have no ability to download anything besides changing the configuration of your downloads to be automated.

Ok so this is not a plugin but a simple program that is called by the user when he needs it, isn't it?
In this case you can dissociate completely from SyMenu. You can write a program that analyzes the item configuration file (it's a simple plain xml file) and modify it directly. Easy as a pie.


jagg3127 wrote:
Ok now I see what you mean by the plugin needing to run every time they clicked an app ok ok. So depending on the programming language we could have the plugin never ask for Admin and only the app you're running to be that cause if you run it you could probably have the app ask for admin so the plugin would never be able to download stuff. Yeah I see the concerns of security but its still a good idea for my use case even if its a plugin only me and some close friends use then I would still want to know how top make a plugin and which programming language it would be in.

If you are curious and want to practice with it, I'll send you the source code of a test plugin I wrote exactly for this reason.

jagg3127 wrote:
Ok I figured out, after some debugging of the two plugins I had, my issue is that I need to know what csproj file your using because I cannot figure out how to import the Libs directory into the dll. Or just inform me how, I could probably figure out the rest.

So wait for my message.
link



UGMFree © 2002-2025
PayPal BTC TON