Make Portable Apps with Pstart, Easist way?

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.
Post Reply
Message
Author
pplknownothin
Posts: 62
Joined: Tue Mar 18, 2008 9:31 am
Location: Maryland:haaha
Contact:

Make Portable Apps with Pstart, Easist way?

#1 Post by pplknownothin »

ok... so i found a small software called shellexecute that allows for applications to run hidden along with other parameters.
So last night i just figured you could use pstart and run a batch hidden with this program and it worked.
I used resource hacker to change the icon of ShellExecute to the same icon as the app
used regapp for registry

feel free to make changes to the batch as needed and please tell me what could make it better
just figured that it's a simple easy way to make apps portable :D

Simple batch i made:

Code: Select all

::comment out or add more as needed
:: To comment out place :: in front of the line

::Backup Registry
cd "%~dp0\Data\backup"
regedit /e Backup1.reg HKEY_LOCAL_MACHINE\SOFTWARE
regedit /e Backup2.reg HKEY_LOCAL_MACHINE\SOFTWARE
regedit /e Backup3.reg HKEY_LOCAL_MACHINE\SOFTWARE

::Backup files
xcopy "Souce" "Destination\Foldername" /E /C /I /H /Y
cd %~dp0

::Copy Files usb To PC
cd "%~dp0\data\settings\Files"
xcopy "Souce" "Destination\Foldername" /E /C /I /H /Y

::apply delete Reg
cd "%~dp0\data\settings"
regedit /s Delete.reg

::Apply settings Registry
Regedit /s Settings1.reg
Regedit /s Settings2.reg
Regedit /s Settings3.reg

::Start and wait
cd "%~dp0\app"
start /wait Appname.exe

::Copy Registry to usb
cd "%~dp0\data"
rmdir /S /Q "settings"
md "settings"
cd settings
regedit /e Settings1.reg HKEY_LOCAL_MACHINE\SOFTWARE
regedit /e Settings2.reg HKEY_LOCAL_MACHINE\SOFTWARE
regedit /e Settings3.reg HKEY_LOCAL_MACHINE\SOFTWARE

::Copy files to usb
cd "location\of\file"
xcopy "Souce" "%~dp0\data\settings\Files\foldername" /E /C /I /H /Y

::apply delete reg
cd "%~dp0\data\settings"
regedit /s Delete.reg

::apply backup reg
cd "%~dp0\data\backup"
regedit /s Backup1.reg
regedit /s Backup2.reg
regedit /s Backup3.reg

::copy backup files
xcopy "Souce" "%~dp0\data\settings\Files\foldername" /E /C /I /H /Y
Exit

Files used:
Pstart:
http://www.pegtop.net/start/
Resource Hacker:
http://www.angusj.com/resourcehacker/
RegFromApp (or any app you prefer):
http://www.nirsoft.net/utils/reg_file_f ... ation.html
ShellExecute:
http://www.optimumx.com/download/#ShellExecute

Folder Layout:(includes a copy of Shellexecute and bat)
http://www.mediafire.com/?ltyzgl2yynn

pplknownothin
Posts: 62
Joined: Tue Mar 18, 2008 9:31 am
Location: Maryland:haaha
Contact:

Re: Make Portable Apps with Pstart, Easist way?

#2 Post by pplknownothin »

I did not see reference to ShellExecute in your batch file
You add the shellexecute to pstart and when you add it add "/f:launch.bat /r:Hidden" under CommandLine Parameters
thats why i switched the icons of shellexecute to the actual app so it show up in pstart
hope that helps a bit

Post Reply