AutoRun LWMenu

If you are currently developing portable freeware or planning to do so, use this forum to discuss technical implementation, seek out like-minded developers for partnership, or solicit interested users for beta testing.
Message
Author
User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#271 Post by sl23 »

Original X-Launcher v1.5.4 source.
Source and Launcher I use is in my signature.

Run X-Stremio. No these folders are not created as they are used in X-Stremio\Lib\AppData\Local\Smart Code ltd and X-Stremio\Lib\stremio for Roaming.

Already tested HOMEPATH, that's mentioned in my post above.

:)
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#272 Post by sl23 »

Just seen your post on AutoIT Portable.
lwc wrote: Sun Apr 28, 2024 10:37 am [*]My current alternative is to run SciTE through a portabilizer (luckily I own one and all it needs is deletefolders="%LocalAppData%\AutoIt v3\").
Seeing as I'm having issues deleting folders, I tried this:
deletefolders="%USERNAME%\AppData\Local\Smart Code ltd\"
Although in the instructions for AutoRun.exe you have stated that quotes aren't required. So what about the %, is that required as well? Or only if enclosed in quotes?

Either way, I tested all different variations and none of it worked. :(
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#273 Post by sl23 »

Well, the only way to get Stremio to use the X-Stremiio\User\AppData folder is to use absolute path name:
setenv=USERPROFILE|D:\MyApps\X-Stremio\User

But then it isn't portable! :roll:
How on earth do I set a relative path?

This is insane! After trying an absolute ton of variations, taking around 10-15 hours, I've managed to figure out how to get Stremio to save it's data in the apps User folder correctly. Using the following code:

Code: Select all

[BUTTON1]
buttontext=Stremio
closemenuonclick=1
relativepathandfilename=App\stremio.exe
setenv=USERPROFILE|D:\MyApps\X-Stremio\User
setenv=APPDATA|User\AppData\Roaming
setenv=LOCALAPPDATA|User
But no matter what I try, I cannot specify a relative path with USERPROFILE.
It really shouldn't be this difficult!
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

lwc
Posts: 285
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#274 Post by lwc »

The original post's link was fixed by the admin. :P

Regarding that comment about quotes, good eyes!!! It's actually a comment from back where relativepathandfilename was the only command with paths, and it indeed needs no quotes.
I've just fixed this comment, so the fix will appear in the next release.
The reason quotes are needed for the other commands is because other commands support multiple values (multiple registry keys/folders/files), and without quotes the launcher will treat space like a separator even if it isn't.
But I'd rephrase what you wrote to:

Code: Select all

deletefolders="%LOCALAPPDATA%\Smart Code ltd\"
About setenv, so I think we once again established USERPROFILE needs to be an absolute path (..\ was a hack that I guess only some programs fall for), which takes us back to me adding a command to auto expand relative environment paths.
It should mean X-Launcher forces you to put the folder in a hardcoded location inside its own folder instead of supporting relative folders and letting you put it wherever you want like in my launcher.
For an immediate hack you can utilize a feature I've added recently (from a request in this forum) of using %backuppath% inside setenv:

Code: Select all

backuppath=User ; should be automatically replaced with an absolute folder
setenv=USERPROFILE|%backuppath%
But attached are screenshots from my internal beta (not released yet) that:
  1. If you add a second | to setenv - will make it auto expand on its own:

    Code: Select all

    setenv=USERPROFILE|User|
    
  2. The help menu has an auto generated list of environment variables (refreshed every time you open it)
Attachments
auto expand env.png
auto expand env.png (7.16 KiB) Viewed 2684 times
list all env.png

User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#275 Post by sl23 »

Excellent, thanks.

So, quotes are only required for specifying multiple registry keys/folders/files?
About 'multiple', Where is this acceptable? ie, Can I use for deletefiles and deletefolders if these were put in quotes and separated with '|', or some other way? I suppose it is better on separate lines, for deletefiles as there could be many and also overcomes character limits, if there are any in AutoRunMenu. But allowing a mixture of both keeps it tidier? Dunno, what do you think about that?

An example in X-Launcher.ini where there is a character limit and I have deleted all language files for SoftMakerFreeOffice:
Spoiler!   

Code: Select all

FileDelete=$Bin$\SM FreeOffice\license-ar.rtf;license-bg.rtf;license-da.rtf;license-de.rtf;license-el.rtf;license-es.rtf;license-et.rtf;license-fi.rtf;license-fr.rtf;license-hu.rtf;license-id.rtf;license-it.rtf;license-ja.rtf;license-kk.rtf;license-ko.rtf;license-lt.rtf;license-lv.rtf;license-nl.rtf;license-pl.rtf;license-pt-br.rtf;license-pt-pt.rtf;license-ro.rtf;license-ru.rtf;license-sl.rtf;license-sv.rtf;license-tr.rtf;license-uk.rtf;license-zh-cn.rtf;PlanMaker_ar.dwr;PlanMaker_bg.dwr;PlanMaker_cz.dwr;PlanMaker_de.dwr;PlanMaker_dk.dwr;PlanMaker_ee.dwr;PlanMaker_es.dwr;PlanMaker_fi.dwr;PlanMaker_fr.dwr;PlanMaker_gr.dwr;PlanMaker_hu.dwr;PlanMaker_id.dwr;PlanMaker_it.dwr;PlanMaker_jp.dwr;PlanMaker_kr.dwr;PlanMaker_kz.dwr;PlanMaker_lt.dwr;PlanMaker_lv.dwr;PlanMaker_nl.dwr;PlanMaker_pb.dwr;PlanMaker_pl.dwr;PlanMaker_pt.dwr;PlanMaker_ro.dwr;PlanMaker_ru.dwr;PlanMaker_se.dwr;PlanMaker_si.dwr;PlanMaker_tr.dwr;PlanMaker_ua.dwr;PlanMaker_us.dwr;PlanMaker_zh.dwr;pmfree_de.chm;pmfreemanual_de.pdf;Presentations_ar.dwr;Presentations_bg.dwr;Presentations_cz.dwr;Presentations_de.dwr;Presentations_dk.dwr;Presentations_ee.dwr;Presentations_es.dwr;Presentations_fi.dwr;Presentations_fr.dwr;Presentations_gr.dwr;Presentations_hu.dwr;Presentations_id.dwr;Presentations_it.dwr;Presentations_jp.dwr;Presentations_kr.dwr;Presentations_kz.dwr;Presentations_lt.dwr;Presentations_lv.dwr;Presentations_nl.dwr;Presentations_pb.dwr;Presentations_pl.dwr;Presentations_pt.dwr;Presentations_ro.dwr;Presentations_ru.dwr;Presentations_se.dwr;Presentations_si.dwr;Presentations_tr.dwr;Presentations_ua.dwr;Presentations_us.dwr;Presentations_zh.dwr;prfree_de.chm;prfreemanual_de.pdf;TextMaker_ar.dwr;TextMaker_bg.dwr;TextMaker_cz.dwr;TextMaker_de.dwr;TextMaker_dk.dwr;TextMaker_ee.dwr;TextMaker_es.dwr;TextMaker_fi.dwr;TextMaker_fr.dwr;TextMaker_gr.dwr;TextMaker_hu.dwr;TextMaker_id.dwr;TextMaker_it.dwr;TextMaker_jp.dwr;TextMaker_kr.dwr;TextMaker_kz.dwr;TextMaker_lt.dwr;TextMaker_lv.dwr;TextMaker_nl.dwr;TextMaker_pb.dwr;TextMaker_pl.dwr;TextMaker_pt.dwr;TextMaker_ro.dwr;TextMaker_ru.dwr;TextMaker_se.dwr;TextMaker_si.dwr;TextMaker_tr.dwr;TextMaker_ua.dwr;TextMaker_us.dwr;TextMaker_zh.dwr;tmfree_de.chm;tmfreemanual_de.pdf|
I'm not sure how this would actually work either:

Code: Select all

deletefolders="%LOCALAPPDATA%\Smart Code ltd\"
Would it delete the system AppData\Local folder or the one in Stremio's User\AppData folder? I was using it to try and delete the one in the system folder, as during testing, I had to manually delete all folders to make sure I knew what was happening. Should've used Absolute paths really I suppose. And I'm guessing that using relative paths will delete the folder I want to keep in the apps folder?

That said, I tried to add a command to delete a folder "Stremio\User\Microsoft" but again, it won't work using: deletefolders="%backuppath%\Microsoft" - EDIT: deletefolders="%USERPROFILE%\Microsoft" Works ok! :)

One thing, is the trailing \ really necessary? I haven't been adding it, although I have tested with and without, and it seems not to be required. Btw, the %backuppath%=User works for adjusting the AppData paths but not for deleting folders.

Will the extra | make the need for backuppath= unnecessary?

It's good that you've added those EnvVar's to the menu, but I for one will never use it. I think it would be a better option to just include an INI file with those in. That way people who don't use the menu still have a reference.

There is another issue, sort of. More of a limitation. As you can only have one AutoRun.inf file in the root folder, you can only use one AutoRun launcher. So, in the case of SoftMakerFreeOffice, you can't have a set of launchers in the root folder. If we could have a way of each Launcher activating a different button without the menu showing that would be helpful. Perhaps when you launch it checks the filename against the name of the buttons and launches one with the same name?

Look forward to the update. :D
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

lwc
Posts: 285
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#276 Post by lwc »

  1. Quotes are needed when there are spaces:

    Code: Select all

    deletefolders="%LOCALAPPDATA%\Smart Code ltd\" "%LOCALAPPDATA%\Something else\ ; will treat it like 2 folders
    deletefolders=%LOCALAPPDATA%\Smart Code ltd\ %LOCALAPPDATA%\Something else\ ; will treat it like 5 folders
    
    The trailing \ isn't needed, it's just for readability.
  2. Multiple is for registry/deletefolder/deletefiles because they're linear.
    setenv and symlink aren't linear because it's it's x|y, as in x does y.
  3. registry/deletefolder/deletefiles delete literally what's written in them. Whatever you write in them gets translated into an absolute path anyway.
  4. I've never said to use %backuppath% in anywhere else except setenv - it was a special request to add it there, because I guess someone already noticed a limitation in environment variables. But soon you'll have auto expand anyway. So it'll be your call whether to use %backuppath%, an extra | or both.
  5. Regarding EnvVar in the menu - they're dynamic and personal, so I don't think they should be hardcoded in a text file.
    With that said, I've just added to the internal beta command line parameter that will show you the environment variables without needing a menu.
  6. Regarding the root folder, you can use the /ini command line parameter to launch the sub-folder with the relevant file...or just have a menu. :)

lwc
Posts: 285
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#277 Post by lwc »

With that said, it's finally time for the new beta. :D

Please everyone who reads this try to carefully test it - I know you're big fans of /skiptobutton=X but I was asked on GitHub to basically reprogram the entire logic to support threads, so that people using the menu in kiosk mode could launch multiple buttons at the same time.
Since this challenge forced me to dig deep in the heart of the launcher, it pretty much affects everything, so please make sure nothing got broken.
The beta also contains the requested third | to auto-expand setenv values, and a dynamic list of environment variables (can be seen by either via the menu or by using a new command line parameter /listenv).
Here it is, much appreciated!

If all goes well, in the next beta I may edit the names of settings that have outdated names (here's looking at you, "CD Menu").
Last edited by lwc on Mon Jun 10, 2024 1:21 pm, edited 1 time in total.

User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#278 Post by sl23 »

Excellent work, thanks for the update! Will test soon as I get time! :D
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

-ElCoyot-
Posts: 134
Joined: Thu Sep 02, 2021 4:42 am

Re: AutoRun LWMenu

#279 Post by -ElCoyot- »

I tested the new beta. Once the program has created a 0.reg file after the first launch, it is no longer possible to restart the program. If you delete the 0.reg file, it starts again. I'm attaching an example, you can check it out. There are two launchers, a new one and an old one.
https://pixeldrain.com/u/cV2zSzA4

User avatar
sl23
Posts: 84
Joined: Fri Jan 02, 2015 6:25 am

Re: AutoRun LWMenu

#280 Post by sl23 »

Only 4 apps set up to use AutoRun so far, but no issues my end :)
Latest X-Launcher_x64 update - Compiled with Aut2exe_x64.exe v3.3.16.1
Latest X-Launcher_x64 v1.5.4 update - Compiled with Aut2exe_x64.exe v3.2.12.1

lwc
Posts: 285
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#281 Post by lwc »

-ElCoyot- wrote: Sun Jun 09, 2024 8:33 pm I tested the new beta. Once the program has created a 0.reg file after the first launch, it is no longer possible to restart the program. If you delete the 0.reg file, it starts again. I'm attaching an example, you can check it out. There are two launchers, a new one and an old one.
https://pixeldrain.com/u/cV2zSzA4
For a quicker review, could you paste it your autorun.inf? It's usually enough.

-ElCoyot-
Posts: 134
Joined: Thu Sep 02, 2021 4:42 am

Re: AutoRun LWMenu

#282 Post by -ElCoyot- »

[CUSTOM CD MENU]
hidetrayicon=1
skiptobutton=3
blinktaskbarwhendone=1
singlerun=1
; netaccess=0
; admin=1

[BUTTON3]
buttontext=HiJackThis
relativepathandfilename=App\HiJackThis.exe
registry=+HKEY_LOCAL_MACHINE\SOFTWARE\HijackThis+
backuppath=App


P.S.
Moreover, this is repeated with any program where there is a 0.reg file save

lwc
Posts: 285
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#283 Post by lwc »

-ElCoyot- wrote: Mon Jun 10, 2024 3:44 am Moreover, this is repeated with any program where there is a 0.reg file save
That was exactly my point in asking in just for the settings' file. :D
Anyway, fixed! Can you test the newest beta?

I hope you all happen to also check the revised menu.

-ElCoyot-
Posts: 134
Joined: Thu Sep 02, 2021 4:42 am

Re: AutoRun LWMenu

#284 Post by -ElCoyot- »

Anyway, fixed!
Good job, thanks.

-ElCoyot-
Posts: 134
Joined: Thu Sep 02, 2021 4:42 am

Re: AutoRun LWMenu

#285 Post by -ElCoyot- »

Hi. You can add such a command to the inf file.
2024-6-21 19-30-26.png
So that when a portable program is closed, the service started by this program is deleted. Here is an example of a cmd file for deleting the theme service (example).
2024-6-21 19-43-9.png
2024-6-21 19-43-9.png (3.22 KiB) Viewed 1434 times
I would like it to be like this: Services=(service name)

Post Reply