Portable - Why not support both x86 and x64 in the same zip package?

General discussion related to "Everything".
Post Reply
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Recently I used my portable Everything (as my other portable programs) in a x86 computer, and my Everything was broken, because I'm usually use my Everything on a x64 computer (x64 version). So I needed to play a little to make it set , good for x86 computer (look for the exe of x86 version).

Take a look in 7+ Taskbar Tweaker structure for example. Why can't Everything have a similar approach?

C:\Portable\7+ Taskbar Tweaker
C:\Portable\7+ Taskbar Tweaker\bin
C:\Portable\7+ Taskbar Tweaker\bin\32
C:\Portable\7+ Taskbar Tweaker\bin\64
C:\Portable\7+ Taskbar Tweaker\7+ Taskbar Tweaker.exe
C:\Portable\7+ Taskbar Tweaker\bin\32\7+ Taskbar Tweaker.ex2
C:\Portable\7+ Taskbar Tweaker\bin\32\inject.dll
C:\Portable\7+ Taskbar Tweaker\bin\64\7+ Taskbar Tweaker.ex2
C:\Portable\7+ Taskbar Tweaker\bin\64\inject.dll
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by void »

I will consider a single package for the Everything 1.5 release.

Thank you for the suggestion.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by therube »

(I'll just note, that in the case of 7TT, you cannot actually run 32/*.exe on a x64 system [nor 64/*.exe on a x86].
"7+ Taskbar Tweaker.exe" itself is x86 & is a "launcher" & all that does is spawn either 32/*.exe or 64/*.exe depending on whether your system is x86 or x64.

Some .exe can be x86/x64. DuplicateCleaner does that. Has a main "dual" .exe, then various .dll are split into x86 / x64 subdirectories. Which dll's gets used, x86 or x64, depends on your system. You really have no say in the matter.

FreeFileSync does similar. A main .exe, x86. That then spawns a separate _Win32 or _x64 .exe. Different here is that if you wanted to, you could physically run _Win32 or _x64 directly. [That is atypical.])


(And of course, you could download both .zip, & zip the two into a new archive...)
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

For the best user experience, the user will want to use the same launcher.

What do you think the ideal structure for Everything would be look like?
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by horst.epp »

Just to support users which such special needs there is no need for an additional launcher module.
The start-up options on different PCs can be different
and they also can use a simple batch or login script to start the correct Everything version.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Just to support users which such special needs
Ye, any user who wants to put Everything on their USB, and wants a real Portable...
The start-up options on different PCs can be different
I don't know what you mean by that.
and they also can use a simple batch or login script to start the correct Everything version.
I don't think you're right about that. The 2 exe versions should use the same settings files.

Even if it is true, that it is possible by certain switches to set it correctly, the normal user does not know how to do it, and you have to get him this script on the download page of voidtools, from where he downloads the portable software.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by therube »

the user will want to use the same launcher
What do you mean by that?
That they want to run a (single) "Everything.exe", & by doing so, it runs the x86 or x64 version, as appropriate?

If so, then you could use the "stub" approach.
Everything.exe, x86, that then loads either Everything_x86.exe or Everything_x64.exe.
(And in which case, you're actually running Everything_x86.exe or Everything_x64.exe.)

Or, you could have both Everything_x86.exe & Everything_x64.exe in the ZIP.
And the user extracts them & can then run either, directly, or rename one or the other to Everything.exe & run that, or...


But in any case, to me, none of that makes any sense.
Making work where there is no reason for it.


(I tend to take the least common denominator case, in most cases.
So I use ZIP, & x86 - unless there is some compelling reason to use x64.

x86 is more universal, as it can be used on x86 & x64.

For particular cases, a web browser, an encoder or similar, you do specifically want x64.
For me, Everything x64 offers no advantages [that I'm aware of] over x86, so I use x86.)
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by horst.epp »

therube wrote: Fri Aug 18, 2023 3:52 pm For me, Everything x64 offers no advantages [that I'm aware of] over x86, so I use x86.)
If you make use of Everything's content indexing, you will see a big difference between the versions.
For a useful amount of data, you definitely need the x64 version.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

the user will want to use the same launcher
What do you mean by that?
That they want to run a (single) "Everything.exe", & by doing so, it runs the x86 or x64 version, as appropriate?
Yes.


I see therube prefer exe-s over dll-s...

I think this question is not relevant to Everything only, but to any Portable software - how to build a correct structure for Portable software.

Questions that need to be solved:

1. Where will the settings files folder be located. As mentioned, the settings files should be in one place, and be used by both versions (x86 and x64) of the exe files.

2. What will the upgrade process look like from version to version.
(I should mention that sometimes it happens that you upgrade to a new version, and then you see that there is a bug or regression in the new version, and you want to roll back to the previous state before the upgrade, and the user have no way to do it.)
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by therube »

1a. just as now, by default, where the .exe is located
1b. "used by both". not IMO. use different instances, &/or different ("installation") directories.

2. you manually download the newer ;-)
2b. sure you can roll back. backup before you upgrade (as you should be doing now, anyhow).
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

2b. sure you can roll back. backup before you upgrade (as you should be doing now, anyhow).
Would you like to tell what your backup mechanism looks like? How long does it take you to restore from the backup?
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by horst.epp »

To make backups which allow fast rollback to any previous version
I make ZPAQ backups of my portable Everything installation, except the database.
The result is one archive from which I can retrieve versions or single files.
ZPAQ is a deduplicating archiver, so the archive consumes no space for unchanged files between versions.
The database can also be saved of course, but this makes the archive bigger and is not necessary for me.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by therube »

Would you like to tell what your backup mechanism looks like? How long does it take you to restore from the backup?
I simply wholesale copy the "InstalDir" (where I extracted Everything to).
It takes a second or two.

Restore?
I'd never actually "restore".
I might compare old against new, or copy a particular file back in, like the .ini, if I managed to screw it up?
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

I have in my "Portable Program Files" some
PortableProgram
PortableProgram_OLD

I think it's the same to what you wrote.

The problem begins with kind of Portable Programs that has a built-in update mechanism, which makes it easier for you and automates the update process, and there is no convention on how to perform the backup, and it simply overwrites the previous version.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

horst.epp wrote: Fri Aug 18, 2023 11:44 amand they also can use a simple batch or login script to start the correct Everything version.
Assuming we have in the same folder
Everything.exe
Everything64.exe

Is it possible, for now, to upload here a bat or exe file, which will be placed in the same folder and be used as a launcher? Will it also be able to pass parameters?

for example:
Everything.exe
Everything64.exe
EverythingPortable.bat

Run: EverythingPortable.bat -startup
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by void »

Code: Select all

@echo OFF

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT

if %OS%==64BIT goto x64

goto x86

:x64

REM echo x64 
Everything64.exe %*

goto exit

:x86

REM echo x86
Everything.exe %*

goto exit

:exit

REM pause
batch file to check 64bit or 32bit OS:
https://stackoverflow.com/questions/12322308/batch-file-to-check-64bit-or-32bit-os
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Thank you. It works, but not ideally, due to the appearance of the cmd window.
I'm not sure but maybe powershell has the magic.
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by horst.epp »

Stamimail wrote: Thu Feb 15, 2024 10:05 am Thank you. It works, but not ideally, due to the appearance of the cmd window.
I'm not sure but maybe powershell has the magic.
The cmd windows can be set to run minimized.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by NotNull »

If you start Everything with start "" Everything64.exe %* instead of Everything64.exe %*, the CMD window will close right away after launching Everything.

BTW: Not sure if reading the bit-ness of the processor gets the bit-ness of the operating system (32-bit Windows can be installed on a 64-bit processor).

The following command will get the bit-ness of the OS:
for /f "useback delims=" %%x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %%x

sets environment vraiable %OSARCHITECTURE% to "64-bit" or "32-bit", which can be used in the script.

Don't know what ARM processors/Windows/Everything give as result.



All untested, btw
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Code: Select all

for /f "useback delims=" %%x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %%x
CMD retrieves:
%%x was unexpected at this time.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by NotNull »

Command-line or script?

Command-line: %x
Script:%%x
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Command-line. Now it retrives nothing (I guess it's expected). I failed in trying to print (echo) the value of variable x.

I don't dabble with programming very often, so I'm quick to give up on trying to solve this myself. For me it will take hours and days (and I won't remember the material) what the experienced will take minutes.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by NotNull »

The following command will get the bit-ness of the OS:
for /f "useback delims=" %%x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %%x

sets environment vraiable %OSARCHITECTURE% to "64-bit" or "32-bit", which can be used in the script.
So the following 2 commands should do on the command-line:

Code: Select all

for /f "useback delims=" %x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %x
 echo Windows is %OSArchitecture%
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by Stamimail »

Thank you NotNull. It seems to work. Still needs to be tested by someone who has both 32/64 operating systems.

Code: Select all

@echo OFF

for /f "useback delims=" %%x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %%x

if %OSARCHITECTURE%==64-bit goto x64

goto x86

:x64

REM echo x64 
start "" Everything64.exe %*

goto exit

:x86

REM echo x86
start "" Everything.exe %*

goto exit

:exit
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Portable - Why not support both x86 and x64 in the same zip package?

Post by NotNull »

Hey, If it works .. it works.

A bit cleaner:

Code: Select all

@echo OFF

for /f "useback delims=" %%x in (`wmic.exe os get OSArchitecture /value`) do @>nul set %%x

if %OSARCHITECTURE%==64-bit   start "" Everything64.exe %*
if %OSARCHITECTURE%==32-bit   start "" Everything.exe   %*

Post Reply