Jump to content











Photo
* * * * * 1 votes

Universal Portable Applications for PE and Windows

portable applications

  • Please log in to reply
10 replies to this topic

#1 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 November 2011 - 02:41 AM

Universal Portable Applications for PE and Windows

So, everyone knows about portables, right? Basically, a single exe you launch by double-clicking and your program is started without fuss or bother; no installation or setup required, just run and go. They're portable, so you can keep them on a thumb drive and use them from any computer. There is a strong appeal for me to use portables in lieu of full installations (even in Windows) because I work on many different computers and need a complete set of tools at the ready on any given machine. Portables allow me to move my 'workbench' from one PC to another, regardless of hardware type or OS by simply plugging in a flash drive. I also need the same tools available in any PE I boot and the tools need to be updatable. This is what is meant by 'universal' portable applications; the free use of them in any work environment and the ease of moving them anywhere you want.

Most portables you find will already work in Windows but many will not work correctly running from PE. That's where ppApps come in, these are special portables designed to 'know' where they're being launched from and act accordingly. e.g. CCleaner, even their portable version will automatically access the registry and system files of the OS its launched from. This is great for Windows but makes no sense in PE where you want to work on the currently offline system. Thanks to Paraglider's runscanner, we can redirect programs like CCleaner to work on the host system. In Winbuilder scripts, this is accomplished by adding commands to the shortcut in PE but in a portable, this must be done internally, running some batch code as part of the program launch. Fortunately, SFX (self-extracting archive) packagers like WinRAR allow for this and are ideal for creating universal portable applications.

I will be presenting a series of applications packaged as universal portables with detailed explanations on how they're setup. I'm a big believer in using examples to learn from; if I can see how someone else does something then I can apply that knowledge for my own needs. There are many different ways of doing the same things and I'm hoping others will offer their favorite methods so we can discuss best practices and improvements. I'm really hoping this can be more like a blog than a tutorial; I'm all about learning better ways of doing things :)

I'll start by setting some ground rules for how a universal portable should behave (then give some examples).

1) The program should launch from any medium (CD/DVD/USB/UFD/HDD) and on any platform (Windows XP/7 PE1/3x) with minimal external support (self-contained); currently testing in Windows XPx86, 7x64 and in LiveXP/Win7PE_SE but should work in other projects as well.

2) The single exe (SFX) works independently in Windows and PE; additional support files for PE only needed for full (script like) installation e.g. file association and shortcuts. In other words, the single exe works fine on its own but if you want full install in PE, add the support files; ppapp.ini, setups.cmd and pe.reg.

3) The SFX (launcher) is able to check system parameters e.g. Windows or PE; XP or 7; x86 or x64 and launch the program accordingly without user intervention*

*There are cases where a prompt e.g. to keep or delete temp files or select a folder is appropriate (more on this later) but this should be kept to a minimum and only used when required.

4) Background activity should be hidden wherever possible i.e. command windows, archive unpack progress etc. This is another reason the application needs to launch quickly; basically, the only thing you should see when dbl-clicking the exe is the program interface launching normally.


Posted Image CCleaner 3.12.1572 x86/64 Portable

Homepage: http://www.piriform.com/ccleaner

Portable: http://www.mediafire...61yyd83ctmdmqk8

Nice, multi-function system cleaner, comes with x64 version of exe and is setup as follows:

@echo off

setlocal

set RegQry=HKLMHardwareDescriptionSystemCentralProcessor0

reg.exe Query %RegQry% > lOS.txt

find /i "x86" < lOS.txt > lSC.txt

if %ERRORLEVEL% == 0 (

if /i '%systemdrive%'=='x:' goto pe

if /i '%systemdrive%'=='y:' goto pe

CCleaner.exe

goto end

:pe

Runscanner.exe /t 0 /sd /ac /m+ /y CCleaner.exe

goto end

) ELSE (

if /i '%systemdrive%'=='x:' goto pe

if /i '%systemdrive%'=='y:' goto pe

CCleaner64.exe

goto end

:pe

Runscanner.exe /t 0 /sd /ac /m+ /y CCleaner64.exe

)

:end

endlocal

del /f /q lOS*,lSC*,cc*,port*,run*

del %0

or you could just do
del /f /q *
to clear out everything in Temp (not a bad idea) ;)


To examine all the files in the package, just rt-click the SFX and select Extract files...
Posted Image

A brief explanation of each:

cc.cmd (above) is the setup batch which launches when SFX is run; this checks the system architecture (x86/64) and whether it's launched from a PE system; if PE, ccleaner(64).exe is run via runscanner or, if Windows, just starts the exe. This is a simple launcher but does everything you need it to. More complicated examples to follow.
cc.js just hides the command window for cc.cmd. This is a standard file you'll find in almost every setup and the only thing that changes is the name of the cmd it runs; in this case cc.cmd.
"cmd.exe /c cc.cmd"

CCleaner(64).exe, ini and dat files are program related (came with program, required to run)
RunScanner*.exe and dll are included for system re-direction support when running from PE.


Test the setup by copying all files to Temp and running cc.js; when ready, create an SFX launcher as follows:
[attachment=12895:wrar1.png] [attachment=12896:wrar2.png] [attachment=12897:wrar3.png]
The rest of the options are unimportant but be sure to select an icon for your SFX.
Use ResHacker or similar to extract the icon from your exe and select it under 'Load SFX icon from file' option.

--
Here's another, virtually identical setup.
Extract the files and see for yourself how this setup can be used as a template for other programs.

Posted Image ProduKey v1.53 x86/64 Portable

Homepage: http://www.nirsoft.n...key_viewer.html

Portable: http://www.mediafire...l2x4g4coat8r4po

--
more to come... The forum editing tools suck, I give up...
  • wimb and joakim like this

#2 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 21 November 2011 - 07:46 AM

Hey Amalux,

:)

Glad you're going back to PPApps!

I remember last you were dealing with scripts and I thought oh no, not scripts again! It did make me wonder abit, why you started the great PPApps thing, and then went back to scripts, but either way, at least you're promoting this thing further.

Hopefully now, various builds of win7PE/LiveXp, will begin to lose weight and run faster!
lol

Ok, enough of me.

:cheers:

#3 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 November 2011 - 08:13 AM

Hey thanks for the encouragement! Yeah, I like both and both serve a purpose but my love is portables and I'm hoping to write more on it but there is something seriously wrong with whoever runs this forum! Took me hours to write that intro, twice lost everything; pictures jumping to other posts; can't delete my own posts; freeze ups, formatting errors etc. I've tried three different browsers, same bs, had to have someone else delete my post (created by forum glitch) but I do have the option to delete your post :shifty:

Maybe when they get their act together I can continue... we'll see ;)

#4 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 21 November 2011 - 01:36 PM

Hi again Amalux,

Well, with all the forum issues you having, perhaps Nuno or wonko can sort things out?

Which reminds me, I should ask Nuno to remove the advanced user under my name.
I personally prefered the way it was when bootland was still around, but I guess I must adapt to the changes.

I did try following your examples the newcomers tutorial that you made, however, the registry stuff seems to confusing for me. specificly where to put the "" and the %%. I really don't know how you got around to figuring that stuff out.

And one last thing before it slips my mind, is there a way in PPAppsgenPE to tell it to look in a different directory other than ppapps?
My reason for asking is, I simply dumped all my applications in that folder, yes, some with the PPApps entry so that they would show up in winPE but others not, so now as you can imagine, that folder is becoming huge, and I would love abit of organization like:
ppapps
anti-virus
audio
etc.
but still have the ppapps working in winPE.
if such a way isn't possible, its fine by me, but I just thought I'd ask.

Regards,

#5 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 November 2011 - 03:50 PM

I did try following your examples the newcomers tutorial that you made, however, the registry stuff seems to confusing for me.

Well, if I can finish writing the tutorial, all will be explained; just be patient for now...


And one last thing before it slips my mind, is there a way in PPAppsgenPE to tell it to look in a different directory other than ppapps?

Great question! Yes there is, give me some time to think about the best way to handle it ;)

#6 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 21 November 2011 - 04:17 PM

Hello again Amalux,

You know, i'm a patient someone. When ever you see fit to update/rewrite the tutorial, it will all be good.

Take your time,
as I'm occupied with few things like the autorecovery tutorial and also trying to build up the contents of my ZM-ve200 caddy.
for which I've given it a name called:
TUTT

Wanna guess what tutt is?
:)

:cheers:
ps.
sorry for going so off topic

#7 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 November 2011 - 04:42 PM

sorry for going so off topic

What was the topic again? ;)


Wanna guess what tutt is?
:)

Oh, oh, I know this one... Tropical Upper Tropospheric Trough http://www.aoml.noaa.../tcfaq/A10.html , right?

#8 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 21 November 2011 - 05:39 PM

Hello Amalux,

Well, I've gone off topic with regard to universal portable applications in winPE,

but I must praise you for thinking hard, too hard infact,

Do you really think I'd give such a name for my caddy?

Unfortunately you were wrong about that tutt.

but my tutt is:
THE ULTIMATE TECHNICIANS TOOLKIT!
:)

But, on a more serious note,
Don't you think its high-time this topic be cleaned?
You have 1000000% right to delete my posts in this topic thus far!
:)
ok, I can't stay serious for even a minute,
Ps.
Thanks for tolerating the highjack, you know, I've been feeling the need lately to highjack something/someone, better a topic, than someone.
:)

Regards,

#9 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 November 2011 - 06:30 PM

No worries, I'm not into deleting posts, even of people I don't like but I like you and I like your posts, so they stay :)

Sorry about getting the TUTT thing wrong (damn, I was sure I had it), I like your title better ;)

#10 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 22 November 2011 - 05:19 AM

I would love abit of organization like:
ppapps
anti-virus
audio
etc.

Here's a modified ppAppsGenPE.exe complete with source in case you want to modify it yourself:
http://www.mediafire...rr1a29biqdd3dq3

Currently it looks in the following directories:
ppApps
ppAppsDevelopment
ppAppsHD Tasks
ppAppsExtras
ppAppsFile Tasks
ppAppsForensics
ppAppsHardware
ppAppsNetwork
ppAppsMulti Media
ppAppsSecurity
ppAppsSetup
ppAppsSystem Tools

This follows the Apps sub directories in PE projects (at least mine) for symmetry but feel free to change it for your own needs. It's very easy to do but if you have questions just ask :)

#11 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 22 November 2011 - 09:11 AM

Hellos Amalux,

Thanks for the PPAppsgen!
I shall see how far I get and sure ask questions if I don't understand.

:)
:cheers:





Also tagged with one or more of these keywords: portable, applications

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users