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

#241 Post by sl23 »

rbon wrote: Thu May 30, 2024 6:56 am For manage icons You need of 2 (two) programs:
1. IconExtract for Nirsoft https://www.nirsoft.net/utils/iconsext.html for extract all icons (as cumulative file) from official program installer
2. Resource Hacker Portable from PortableApps https://portableapps.com/apps/utilities ... r-portable
Actually, only Resource Hacker is required. When performing the replace icon, you can select an exe file that contains the icon you want. :)
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
rbon
Posts: 399
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: AutoRun LWMenu

#242 Post by rbon »

To sl23:
I have a small doubt about the post viewtopic.php?p=107021#p107021 by sl23.
What exactly does StemRoller write to AppData ?
- a 'stemroller' folder - exact ?
- a configuration file inside this folder? If so, with what name and extension ?

I need this infos to propose a new version of the 'Autorun.inf' file.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: AutoRun LWMenu

#243 Post by sl23 »

Hi there, :)
7.44MB / 68 Files in AppData\Roaming\stemroller:

Code: Select all

; D:\MyApps\ARM-StemRoller\User\AppData\Roaming\stemroller :
blob_storage= DIR
Cache= DIR
Code Cache= DIR
DawnCache= DIR
GPUCache= DIR
Local Storage= DIR
Network= DIR
Session Storage= DIR
config.json
Local State
Preferences
Probably less than 10 files have an extension name.

On first run: 5.9MB / 37 Files in AppData\Roaming\stemroller
.
stemroller.zip
This contains the default first run set of Roaming files. The cache folder grows with use I think.
(18.73 KiB) Downloaded 110 times
Here's the AutoRun.inf code:

Code: Select all

[AutoRun]
open=AutoRun.exe
icon=AutoRun.exe, 0

[CUSTOM CD MENU]
skiptobutton=1
singlerun=1

[BUTTON1]
buttontext=Stem Roller
closemenuonclick=1
relativepathandfilename=App\StemRoller\StemRoller.exe
;setenv=USERPROFILE|..\..\User
setenv=APPDATA|..\..\User\AppData\Roaming
At present, it still uses the system AppData\Roaming\stemroller folder.
If I uncomment the second to last line, then StemRoller.exe will not start.
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
rbon
Posts: 399
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: AutoRun LWMenu

#244 Post by rbon »

sl23 wrote: Sun Jun 02, 2024 12:25 pm Here's the AutoRun.inf code:

Code: Select all

[AutoRun]
open=AutoRun.exe
icon=AutoRun.exe, 0

[CUSTOM CD MENU]
skiptobutton=1
singlerun=1

[BUTTON1]
buttontext=Stem Roller
closemenuonclick=1
relativepathandfilename=App\StemRoller\StemRoller.exe
;setenv=USERPROFILE|..\..\User
setenv=APPDATA|..\..\User\AppData\Roaming
At present, it still uses the system AppData\Roaming\stemroller folder.
If I uncomment the second to last line, then StemRoller.exe will not start.
About AutoRun.inf
--------------------------------------------------------------------------------------
I saw your 'autorun.inf' file and would like to propose some changes:
1.
original code

Code: Select all

relativepathandfilename=App\StemRoller\StemRoller.exe
changed as

Code: Select all

relativepathandfilename=App\StemRoller.exe
I suggest You to move all content of folder \StemRoller to folder \App: (You must move up 1 level, like yaP logic) and delete the empty folder \StemRoller.

2.
original code

Code: Select all

setenv=APPDATA|..\..\User\AppData\Roaming
changed as

Code: Select all

setenv=APPDATA|\App\stemroller\*.*
3.
move the subfolder contained in %AppData% (\stemroller) inside \App.
The subfolder \stemroller must moved with All subdirectories and other configuration files.
--------------------------------------------------------------------------------------------

This way it should work (I think so)
I suggest You also to rename the file name of 'Autorun_x64.exe' to 'StemRollerPortable_x64.exe', like yaP launcher name.

Here You have a list of Environment variables on Windows:
Here You have also the icon of StemRoller:

After all changes You must have a new file AutoRun.inf like this

Code: Select all

[AutoRun]
open=AutoRun.exe
icon=AutoRun.exe, 0

[CUSTOM CD MENU]
skiptobutton=1
singlerun=1

[BUTTON1]
buttontext=Stem Roller
closemenuonclick=1
relativepathandfilename=App\StemRoller.exe
;setenv=USERPROFILE|..\..\User
setenv=APPDATA|\App\stemroller\*.*
b.t.w.
I haven't change anything on commented USERPROFILE.

If this new configuration works, I tell You why.
Attachments
Environment variables on Windows (7, 8, 10 and 11).zip
(1.53 KiB) Downloaded 117 times
StemRoller icon 256x256_ico.zip
(31.48 KiB) Downloaded 107 times
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: AutoRun LWMenu

#245 Post by sl23 »

Thanks rbon :)
I tried exactly what you said, but unfortunately, still uses the system AppData directory.
I have also looked up Windows EnvVar List and copy and pasted it to an RTF file for reference. But will take a look at yours to see if I'm missing something.
The icon is another thing though, I understand it's for showing in the AutoRun Menu, yes? But it doesn't appear in the menu. But then, in practise, I will never use the menu part of AutoRun anyway. So I suppose the only way to get the icon is to add it to AutoRun via Resource Hacker. I have already done this, so don't need the icon, but thank you for your efforts. :)

btw, for the icon, I tried both of these, but neither worked:
- This is the standard X-Launcher icon used to test, path is correct:

Code: Select all

icon=User\Graphics\x-icon.ico
- Directly trying to access the EXE icon, as it does with AutoRun:

Code: Select all

icon=App\StemRoller.exe, 0
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: 284
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#246 Post by lwc »

Hi, again I stress I don't think Stem Roller uses environment variables to determine where is appdata, at least neither APPDATA nor USERPROFILE. Can Stem Roller's author just tell you how does it decide where is appdata? Have they a forum or GitHub issues/discussions for you to ask?

As for icon, I don't think there's a way in the world to change the icons of EXE files dynamically - because icons are hardcoded inside the EXE files. You can compile the source code yourself to change the icon, but it's probably much easier to just use an icon changer program.
The icon= part, just like everything in the [AutoRun] section, is not part of my program, but just the standard part of autorun.inf (see in Wikipedia).
In other words, icon= determines for Windows which icon to use for a device that has autorun.inf in its root folder.

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

Re: AutoRun LWMenu

#247 Post by -ElCoyot- »

lwc
I understand that when writing the program, you tested it. So bring me please provide an example of a program where "setenv=" works.

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

Re: AutoRun LWMenu

#248 Post by lwc »

Sure, for proof of concept I just try:

Code: Select all

[BUTTON1]
buttontext=CMD
relativepathandfilename=cmd ; would try to launch through the OS path
optionalcommandlineparams=
setenv=appdata|testing
Then inside CMD run set or set set appdata and you'll see it got changed (also try without the launcher to compare).

For real life usage - the free program QFGImporter requires .NET6, so instead of installing it I download the standalone dotnet v6 folder, then use:

Code: Select all

[BUTTON1]
buttontext=QFGImporter
relativepathandfilename=QFGImporter.exe
optionalcommandlineparams=
closemenuonclick=1
setenv=DOTNET_ROOT|dotnet
The DOTNET_ROOT environment variable instructs Windows to look for the dotnet folder instead of expecting me to install it.
If you don't have v6 installed, QFGImporter simply refuses to run, so that's how you know it works for sure.

With .NET6 being very outdated, I've actually tried to document this example to keep QFGImporter alive, but QFGImporter's author rejected my attempts. Feel free to intervene.

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

Re: AutoRun LWMenu

#249 Post by -ElCoyot- »

Yes, your example works.
2024-6-4 14-4-46.png
But I would like an example program where the variables "%APPDATA%","%LOCALAPDATA%", "%ALLUSERSPROFILE%" are used. And also, how did you define "DOTNET_ROOT"?

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

Re: AutoRun LWMenu

#250 Post by sl23 »

lwc wrote: Mon Jun 03, 2024 1:31 pm Hi, again I stress I don't think Stem Roller uses environment variables to determine where is appdata, at least neither APPDATA nor USERPROFILE. Can Stem Roller's author just tell you how does it decide where is appdata? Have they a forum or GitHub issues/discussions for you to ask?
Well that's the problem I don't understand. If I don't specify this in the X-Launcher, then X-Launcher doesn't portablise StemRoller's AppData folder:

Code: Select all

[Environment]
USERPROFILE=$Lib$\
And this is an Environment Variable, isn't it? Before I did this, nothing worked. StemRoller would ignore every instruction in any app portabliser, until I added this to X-Launcher and X-Launcher is the only one that works.

I tried going on Discord, but it won't allow me to claim the account! I don't use Discord so it's been a hassle trying to set it up! Went onto GitHub and created a New Issue. Hopefully, someone will get back to me about it.
lwc wrote: Mon Jun 03, 2024 1:31 pmAs for icon, I don't think there's a way in the world to change the icons of EXE files dynamically - because icons are hardcoded inside the EXE files. You can compile the source code yourself to change the icon, but it's probably much easier to just use an icon changer program.
The icon= part, just like everything in the [AutoRun] section, is not part of my program, but just the standard part of autorun.inf (see in Wikipedia).
In other words, icon= determines for Windows which icon to use for a device that has autorun.inf in its root folder.
Ah I see now, I thought the AutoRun section was your doing, but it's the old AutoRun file! Thanks for the info and the link.
I have used Resource Hacker to add the icon to the AutoRunx64.exe anyway. :D

In all honesty, I would love to switch to using AutRunMenu for all my launcher needs, but if this doesn't work, I can't. Meaning I'll have to stick with the broken X-Launcher! I will try to learn how to fix it, but not sure if I can any more that I suffer with chronic insomnia!
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

#251 Post by sl23 »

Received from StemRoller dev:
Thanks for notifying me about this! I didn't know there was an active effort to get StemRoller running portably. I'm not available much over the next couple of weeks, but I'll try to figure out why it's not respecting the environment variable when I get a free moment. If you want to continue your own research, StemRoller is based on Electron (same as GitHub Desktop, VS Code, etc.) so maybe you can find some similar issues reported elsewhere.
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: 284
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#252 Post by lwc »

Thanks for the GitHub issue! Here's a link for reference.
-ElCoyot- wrote: Tue Jun 04, 2024 3:13 am But I would like an example program where the variables "%APPDATA%","%LOCALAPDATA%", "%ALLUSERSPROFILE%" are used.
Don't have 1 handy, since usually such programs rely on installations (drivers, Windows Services, etc.).
But if you think some specific environment variables have special rules, then we need to figure out those rules which are undocumented as far as I know.
There's 1 potential rule I think is worth to try out - full paths. Create c:\something\appdata and then use full paths in setenv:

Code: Select all

[BUTTON1]
buttontext=Stem Roller
closemenuonclick=1
relativepathandfilename=App\StemRoller\StemRoller.exe
setenv=USERPROFILE|c:\something
setenv=APPDATA|c:\something\appdata
If it works,please try just one of these setenv and see if it's enough.
And also, how did you define "DOTNET_ROOT"?
Not sure I understand the question, simply declaring setenv=DOTNET_ROOT|dotnet means I make sure to define %DOTNET_ROOT% in the context of the run.

User avatar
rbon
Posts: 399
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: AutoRun LWMenu

#253 Post by rbon »

To Iwc

I have open with an editor the file 'Autorun.inf' and have seen at top of file:
[AutoRun]
open=AutoRun.exe
icon=AutoRun.exe, 0
;The ", 0 " above, tells Windows to use the icon embedded in AutoRun.exe.
;If you do not want any icon in My Computer, put a semicolon in front of the icon line.
;If using your own icon file, use this line instead-
;icon=icon.ico
My question is:
if I use the program AutoRun_x64.exe, must I change the description inside file 'Autorun.inf' ?
In other words, must I made changes like these ?
[AutoRun]
open=AutoRun_x64.exe
icon=AutoRun.exe, 0
;The ", 0 " above, tells Windows to use the icon embedded in AutoRun.exe.
;If you do not want any icon in My Computer, put a semicolon in front of the icon line.
;If using your own icon file, use this line instead-
;icon=icon.ico
Thanks.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

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

Re: AutoRun LWMenu

#254 Post by sl23 »

I did use this once, and although a long time ago, I think yes, you do need to change the open=NAME OF PROGRAM
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: 284
Joined: Tue Jun 26, 2012 10:40 pm
Contact:

Re: AutoRun LWMenu

#255 Post by lwc »

Any progress with my suggestion for Stem Roller?

As for the [AutoRun] section, in theory yes, but remember this whole section only matters if you run the launcher from an external device.
But even in external devices, as this FAQ explains, the open command is most likely to be completely ignored anyway, unless you use older Windows or older devices (i.e. CD-ROM/DVD). If you really want to, you can fix the filename in icon= or add other commands (only label=, unless it's CD-ROM/DVD).

Post Reply