Old 23rd November 2008, 20:16   #1
cyberdude
Junior Member
 
Join Date: Aug 2008
Posts: 2
Question Using NSIS to create portable app?

I would like to expand upon a portable app which I am currently packaging with WinRAR SFX. It does everything I need except I would like to be able to pass a parameter to my extracted app - something I would imagine I can do with NSIS.

So, I have an app I would like to package up with NSIS, and when the user clicks on the install, I want to extract the packaged files to the users TEMP path, run the EXE, then after the user exits - delete the temporary (application) files, and exit the install.

1. I am new to NSIS, so for starters, can I utilize NSIS for this?

2. I would like to pass the Path (of where the NSIS setup exe is being ran from) to the spawned application as a parameter. The purpose is so a user can run the NSIS packaged app from a USB drive, and so the application will read a related data file from the same path (if it exists). Can this be done?

Thanks in advance for helping a newbie.

Cyberdude
cyberdude is offline   Reply With Quote
Old 23rd November 2008, 21:54   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,445
try something like:

outfile someportableapp.exe
page instfiles

section
initpluginsdir
setoutpath $pluginsdir
file theapp.exe
execwait '"$pluginsdir\theapp.exe" "$exedir"'
setoutpath $temp
sectionend

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump