You are here

Standalone exe(Script Test 1)

12 posts / 0 new
Last post
Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
Standalone exe(Script Test 1)

Ok here is what I was working on yesterday for like an hour, ill probably add more features, but right now im experimenting with several different things for different scenarios.
Default setup

-\ 
Ok you can pretty much change the above to you own folders if you change it in the NSIS script. The above is pretty basic.
Ok now here is the script(I wrote this for recuva)
!define NAME "OperaUsb"
!define SHORTNAME "OperaUsb"
!define VERSION "9.2.2.27"
!define FILENAME "OperaUsb"
!define CHECKRUNNING "OperaUsb.exe"
!define CLOSENAME "OperaUsb"
!define ADDONSDIRECTORYPRESERVE "NONE"


;==Program Details
Name "${NAME}"
OutFile "..\..\..\${FILENAME}.exe"
InstallDir "\${SHORTNAME}"
Caption "${NAME} | Standalone"
VIProductVersion "${VERSION}"
VIAddVersionKey ProductName "${NAME}"
VIAddVersionKey LegalCopyright "Nathan9222"
VIAddVersionKey FileDescription "${NAME}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey InternalName "${NAME}"
VIAddVersionKey OriginalFilename "${FILENAME}.exe"

;=== Runtime Switches
;SetDatablockOptimize on
;SetCompress off
SetCompressor /SOLID lzma
CRCCheck on
AutoCloseWindow True
RequestExecutionLevel user

;=== Include
!include FileFunc.nsh
!include LogicLib.nsh
!include Registry.nsh

;=== Program Icon
Icon "..\..\Icon\appicon.ico"

Function .onInit
SetSilent silent
FunctionEnd

Section "Main"
SetOutPath "$TEMP"
File "..\..\opera927en\*.*"
SetOutPath "$TEMP"
File /r "..\..\opera927en\*.*"
;==MainLaunch
ExecWait '"$INSTDIR\OperaUsb.exe"'
Goto Start

Start:
ExecWait "$TEMP\op.com"
Goto End
	
End:  
	RMDir /r "$TEMP\opera"
	RMDir /r "$TEMP\classes"
	RMDir /r "$TEMP\profile"
	RMDir /r "$TEMP\defaults"
	RMDir /r "$TEMP\program"
	RMDir /r "$TEMP\skin"
	RMDir /r "$TEMP\styles"
	RMDir /r "$TEMP\mail"
	Delete "c3nform.vxml"
	Delete "chartables.bin"
	Delete "dialog.ini"
	Delete "english.lng"
	Delete "fastforward.ini"
	Delete "GSAR.EXE"
	Delete "html40_entities.dtd"
	Delete "License.rtf"
	Delete "lngcode.txt"
	Delete "o9u.dat"
	Delete "op.com"
	Delete "Opera.dll"
	Delete "operadef6.ini"
	Delete "operausb.exe"
	Delete "ouniansi.dll"
	Delete "plugin-ignore.ini"
	Delete "rules.dat"
	Delete "search.ini"
	Delete "spellcheck.dll"
	Delete "spellcheck.ini"
	Delete "xmlentities.ini"
	${registry::DeleteKey} "HKEY_CURRENT_USER\Software\Opera Software" $R0
	${registry::Unload}
SectionEnd

Ok I believe that the above is pretty straight forward. If you want remove the options for it to backup any settings if you want just a one time app. If you use a program that uses the registry just put it at the end to delete, and put somewhere in the beggining to backup it if that registry is already present. This is just a basic outline, Ill be trying to add more and make it better real soon. I also believe it is best not to compress the original apps settings like its exe etc, with App compactor found here. Seems to increase loading times and really has not affect with the output file size, only when it unpacks itself will it have an affect.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Live mode

Investigate "Live" mode. (In the readme file in Other\Source)

It doesn't use the installer, though.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
I looked in....

I looked through the readme but couldn find what you talking about....

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
Nevermind....

I found an example NSIS script on there site,
All I have to put was this before its section

Function .onInit
SetSilent silent
FunctionEnd

Maybe once I get this script a little more "Professional Looking" and I can make it run more efficient, I might post it here.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

wraithdu
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2007-06-27 20:22
At the top of the script

At the top of the script write

SilentInstall silent
Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
What would be best......

What really is the whole concept of a standalone app? I mean settings wise, because I made a standalone app with the script I wrote and I included an option to backup the settings to the $EXEDIR, which is cool if the exe is in the same directory most of the time. Would it be better to make just the whole thing a one time use app, where everything is deleted that it made?

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
Can someone help......

What would be needed in the script to make sure everything runs smoothly and the same if somehow the application had a second launch?

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
Edit:

Ok I have been experimenting with the script for a few minutes and found a major bug, If you have been using my script please change the following

File "..\..\(Application Folder Name)\*.*"
SetOutPath "(Path where you want files to go)"
File /r "..\..\(Application Folder Name)\*.*"

To this......

SetOutPath "(Path where you want files to go)"
File "..\..\(Application Folder Name)\*.*"
SetOutPath "(Path where you want files to go)"
File /r "..\..\(Application Folder Name)\*.*"

There needs to be two SetOutPath or the files will be extracted to your C:\ folder, which is where I found some of the program at.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
k....

I need help with this....Does anyone know how to be able to extract the files to a Folder within Temp folder, and be able to delete it everything when the program exits, even the folder.. I tried "RMDir /r" and "Delete" But im thinking it wont delete the folder because some reason the folder is being accessed. and ive been trying a few things but I have had no success.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

haustin
Offline
Last seen: 12 years 7 months ago
Joined: 2007-09-19 17:59
plugins

Look at the way the launchers handle the splash screen...

The Plugins directory behaves exactly as you wish.

-hea

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
ahhh....

Nice ill look right now..Cant believe I didnt realize that. Thanks for the tip.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 6 months ago
Developer
Joined: 2007-12-06 22:35
Cant get it....

I looked but I was wondering if I could make some external app and launch it after The Standalone one exits. I tried once, I made a small program but it wont do anything.Is there a way to do like a restart of the standalone app but not have it access that folder.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Log in or register to post comments