You are here

can some experts help a noob like me with 2 things please?

11 posts / 0 new
Last post
kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
can some experts help a noob like me with 2 things please?

okay i have made a few launchers for some games and im having a issue with the splash screen not showing up can someone take a look at them for me?

Heres the forum post for one of them: https://portableapps.com/node/20578

also can someone tell me how i can turn my launchers into paf live launchers so the files get downloaded automatically for people?

you can check the OpenSonicPortable.nsi file in the opensonic launcher and stuff if you need to look at the coding of the .nsi file

OliverK
OliverK's picture
Offline
Last seen: 2 years 9 months ago
Developer
Joined: 2007-03-27 15:21
pastebin the source please.

pastebin the source please.

[link to pastebin fixed by mod Tim]

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

scremingwhisper1720
scremingwhisper1720's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2009-07-15 18:50
opnensonic nsi
;Copyright (C) 2004-2008 John T. Haller
;Copyright (C) 2008 Travis Carrico

;Website: http://PortableApps.com/SecretMaryoChroniclesPortable

;This software is OSI Certified Open Source Software.
;OSI Certified is a certification mark of the Open Source Initiative.

;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.

;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

!define PORTABLEAPPNAME "OpenSonic Portable"
!define APPNAME "OpenSonic"
!define NAME "OpenSonicPortable"
!define VER "1.1.0.0"
!define WEBSITE "PortableApps.com/OpenSonicPortable"
!define DEFAULTEXE "OpenSonic.exe"
!define DEFAULTAPPDIR "OpenSonic"
!define DEFAULTSETTINGSPATH "settings"

;=== Program Details
Name "${PORTABLEAPPNAME}"
OutFile "..\..\${NAME}.exe"
Caption "${PORTABLEAPPNAME} | PortableApps.com"
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${PORTABLEAPPNAME}"
VIAddVersionKey Comments "Allows ${APPNAME} to be run from a removable drive.  For additional details, visit ${WEBSITE}"
VIAddVersionKey CompanyName "PortableApps.com"
VIAddVersionKey LegalCopyright "PortableApps.com and contributers"
VIAddVersionKey FileDescription "${PORTABLEAPPNAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${PORTABLEAPPNAME}"
VIAddVersionKey LegalTrademarks "PortableApps.com is a Trademark of Rare Ideas, LLC."
VIAddVersionKey OriginalFilename "${NAME}.exe"
;VIAddVersionKey PrivateBuild ""
;VIAddVersionKey SpecialBuild ""

;=== Runtime Switches
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True
RequestExecutionLevel user

; Best Compression
SetCompress Auto
SetCompressor /SOLID lzma
SetCompressorDictSize 32
SetDatablockOptimize On

;=== Include
!include "GetParameters.nsh"
!include "MUI.nsh"
!include "TextFunc.nsh"
!insertmacro ConfigWrite
!insertmacro ConfigRead

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

;=== Icon & Stye ===
!define MUI_ICON "..\..\App\AppInfo\appicon.ico"

;=== Languages
!insertmacro MUI_LANGUAGE "English"

LangString LauncherFileNotFound ${LANG_ENGLISH} "${PORTABLEAPPNAME} cannot be started. You may wish to re-install to fix this issue. (ERROR: $MISSINGFILEORPATH could not be found)"
LangString LauncherAlreadyRunning ${LANG_ENGLISH} "Another instance of ${APPNAME} is already running. Please close other instances of ${APPNAME} before launching ${PORTABLEAPPNAME}."
LangString LauncherAskCopyLocal ${LANG_ENGLISH} "${PORTABLEAPPNAME} appears to be running from a location that is read-only. Would you like to temporarily copy it to the local hard drive and run it from there?$\n$\nPrivacy Note: If you say Yes, your personal data within ${PORTABLEAPPNAME} will be temporarily copied to a local drive. Although this copy of your data will be deleted when you close ${PORTABLEAPPNAME}, it may be possible for someone else to access your data later."
LangString LauncherNoReadOnly ${LANG_ENGLISH} "${PORTABLEAPPNAME} can not run directly from a read-only location and will now close."

Var PROGRAMDIRECTORY
Var SETTINGSDIRECTORY
Var ADDITIONALPARAMETERS
Var EXECSTRING
Var PROGRAMEXECUTABLE
Var INIPATH
Var DISABLESPLASHSCREEN
Var ISDEFAULTDIRECTORY
Var SECONDARYLAUNCH
Var MISSINGFILEORPATH
Var WIDTH
Var HEIGHT
Var ONELESSW
Var ONELESSH
Var LASTCOMPUTER
Var CURRENTCOMPUTER

Function ".onInit"
System::Call 'user32::GetSystemMetrics(i 0) i .r0'
System::Call 'user32::GetSystemMetrics(i 1) i .r1'
StrCpy $WIDTH $0
StrCpy $HEIGHT $1

FunctionEnd

Section "Main"
	;=== Check if already running
	System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${NAME}2") i .r1 ?e'
	Pop $0
	StrCmp $0 0 CheckForINI
		StrCpy $SECONDARYLAUNCH "true"

	CheckForINI:
	;=== Find the INI file, if there is one
		IfFileExists "$EXEDIR\${NAME}.ini" "" NoINI
			StrCpy "$INIPATH" "$EXEDIR"
			Goto ReadINI

	ReadINI:
		;=== Read the parameters from the INI file
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APPNAME}Directory"
		StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\$0"
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SettingsDirectory"
		StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\$0"

		;=== Check that the above required parameters are present
		IfErrors NoINI

		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "AdditionalParameters"
		StrCpy "$ADDITIONALPARAMETERS" $0
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "DisableSplashScreen"
		StrCpy "$DISABLESPLASHSCREEN" $0

	;CleanUpAnyErrors:
		;=== Any missing unrequired INI entries will be an empty string, ignore associated errors
		ClearErrors
		StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"
		;=== Correct PROGRAMEXECUTABLE if blank
		StrCmp $SETTINGSDIRECTORY "" "" CheckForProgramINI
			StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\Data\${DEFAULTSETTINGSPATH}"
			Goto CheckForProgramINI
			
	CheckForProgramINI:
		IfFileExists "$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" FoundProgramEXE NoProgramEXE

	NoINI:
		;=== No INI file, so we'll use the defaults
		StrCpy "$ADDITIONALPARAMETERS" ""
		StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"
		StrCpy "$DISABLESPLASHSCREEN" "false"

		IfFileExists "$EXEDIR\App\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" NoProgramEXE
			StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\App\${DEFAULTAPPDIR}"
			StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\Data\${DEFAULTSETTINGSPATH}"
			StrCpy "$ISDEFAULTDIRECTORY" "true"
			GoTo FoundProgramEXE

	NoProgramEXE:
		StrCpy $MISSINGFILEORPATH $PROGRAMEXECUTABLE
		MessageBox MB_OK|MB_ICONEXCLAMATION `$(LauncherFileNotFound)`
		Abort
	
	FoundProgramEXE:
		;=== Check if already running
		StrCmp $SECONDARYLAUNCH "true" CheckForSettings
		FindProcDLL::FindProc "$PROGRAMEXECUTABLE"
		StrCmp $R0 "1" WarnAnotherInstance CheckForSettings

	WarnAnotherInstance:
		MessageBox MB_OK|MB_ICONINFORMATION `$(LauncherAlreadyRunning)`
		Abort
	
	CheckForSettings:
		IfFileExists "$SETTINGSDIRECTORY\config.xml" SettingsFound
		StrCmp $SECONDARYLAUNCH "true" SettingsFound
		;=== No settings found
		StrCmp $ISDEFAULTDIRECTORY "true" CopyDefaultSettings
		CreateDirectory $SETTINGSDIRECTORY
		Goto SettingsFound
	
	CopyDefaultSettings:
		CreateDirectory "$EXEDIR\Data"
		CreateDirectory "$EXEDIR\Data\settings"
		CopyFiles /SILENT $EXEDIR\App\DefaultData\settings\*.* $EXEDIR\Data\settings
		Sleep 100

	SettingsFound:
		StrCmp $DISABLESPLASHSCREEN "true" GetPassedParameters
			;=== Show the splash screen before processing the files
			${ConfigRead} "$SETTINGSDIRECTORY\config.xml" '	' +5
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"	
			newadvsplash::show /NOUNLOAD /PASSIVE 1500 0 0 -1 /L $PLUGINSDIR\splash.jpg
			Goto GetPassedParameters
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"	
			newadvsplash::show /NOUNLOAD 1500 0 0 -1 /L $PLUGINSDIR\splash.jpg

	GetPassedParameters:
		;=== Get any passed parameters
		Call GetParameters
		Pop $0
		StrCmp "'$0'" "''" "" LaunchProgramParameters

		;=== No parameters
		StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE"`
		Goto AdditionalParameters

	LaunchProgramParameters:
		StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" $0`

	AdditionalParameters:
		StrCmp $ADDITIONALPARAMETERS "" WriteSettings

		;=== Additional Parameters
		StrCpy $EXECSTRING `$EXECSTRING $ADDITIONALPARAMETERS`

	WriteSettings:
		StrCmp $SECONDARYLAUNCH "true" LaunchAndExit
		${ConfigWrite} "$SETTINGSDIRECTORY\config.xml" '	' $R0
		Sleep 100
		IfFileExists "$SETTINGSDIRECTORY\${NAME}Settings.ini" "" +2
		ReadINIStr $LASTCOMPUTER "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastComputer"
		System::Call 'kernel32.dll::GetComputerNameA(t .r0,*i ${NSIS_MAX_STRLEN} r1)i.r2'
		StrCpy $CURRENTCOMPUTER $0
		StrCmp $LASTCOMPUTER $CURRENTCOMPUTER MoveFile
		
		IntCmp "2148" "$WIDTH" "" "" +5
		IntCmp "1636" "$HEIGHT" "" "" +4
		StrCpy "$ONELESSW" "2048"
		StrCpy "$ONELESSH" "1536"
		Goto WriteOneLess
		IntCmp "1700" "$WIDTH" "" "" +5
		IntCmp "1300" "$HEIGHT" "" "" +4
		StrCpy "$ONELESSW" "1600"
		StrCpy "$ONELESSH" "1200"
		Goto WriteOneLess
		IntCmp "1380" "$WIDTH" "" "" +5
		IntCmp "1124" "$HEIGHT" "" "" +4
		StrCpy "$ONELESSW" "1280"
		StrCpy "$ONELESSH" "1024"
		Goto WriteOneLess
		IntCmp "1124" "$WIDTH" "" "" +5
		IntCmp "868" "$HEIGHT" "" "" +4
		StrCpy "$ONELESSW" "1024"
		StrCpy "$ONELESSH" "768"
		Goto WriteOneLess
		IntCmp "900" "$WIDTH" "" "" +5
		IntCmp "700" "$HEIGHT" "" "" +4
		StrCpy "$ONELESSW" "800"
		StrCpy "$ONELESSH" "600"
		Goto WriteOneLess
		StrCpy "$ONELESSW" "640"
		StrCpy "$ONELESSH" "480"
		Goto WriteOneLess

	WriteOneLess:
		${ConfigWrite} "$SETTINGSDIRECTORY\config.xml" '	' $R0
		${ConfigWrite} "$SETTINGSDIRECTORY\config.xml" '	' $R0
		${ConfigWrite} "$SETTINGSDIRECTORY\config.xml" '	' $R0
		Sleep 100
	
	MoveFile:
		WriteINIStr "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastComputer" "$CURRENTCOMPUTER"
		Rename "$SETTINGSDIRECTORY\config.xml" "$PROGRAMDIRECTORY\config.xml"
		Sleep 100
		Goto LaunchNow
	
	LaunchNow:
		SetOutPath "$PROGRAMDIRECTORY"
		ExecWait $EXECSTRING
		
	CheckRunning:
		Sleep 1000
		FindProcDLL::FindProc "${DEFAULTEXE}"                  
		StrCmp $R0 "1" CheckRunning
		Rename "$PROGRAMDIRECTORY\config.xml" "$SETTINGSDIRECTORY\config.xml"
		Delete "$PROGRAMDIRECTORY\stdout.txt"
		Delete "$PROGRAMDIRECTORY\stderr.txt"
		Delete "$TEMP\cegui.log"
		Sleep 100
		Goto TheEnd

	LaunchAndExit:
		SetOutPath "$PROGRAMDIRECTORY"
		Exec $EXECSTRING
	
	TheEnd:
		newadvsplash::stop /WAIT
SectionEnd

60\/\/ 2 /\/\3 4 1 4/\/\ 12007
bow to me for i am root

kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
lol i see one thing i could fix...

theres a lnik there that doesnt belong lol. ill fix that tonight. its from when i was using another .nsi file as a template lol.

Dalton M. Kadar

(Don't Mind Me I'm A Noob)

OliverK
OliverK's picture
Offline
Last seen: 2 years 9 months ago
Developer
Joined: 2007-03-27 15:21
I've found sometimes you're

I've found sometimes you're better off scraping the launcher and starting over. (I'm doing that with camstudio. Its so old, I'm just gonna grab the latest source and rewrite the main section.)

SettingsFound:
StrCmp $DISABLESPLASHSCREEN "true" GetPassedParameters
;=== Show the splash screen before processing the files
${ConfigRead} "$SETTINGSDIRECTORY\config.xml" ' ' +5
InitPluginsDir
File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
newadvsplash::show /NOUNLOAD /PASSIVE 1500 0 0 -1 /L $PLUGINSDIR\splash.jpg
Goto GetPassedParameters
InitPluginsDir
File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
newadvsplash::show /NOUNLOAD 1500 0 0 -1 /L $PLUGINSDIR\splash.jpg

Any reason you've decided to show the splash screen twice? I've not studied it all, but I think you'd be better off just doing this:
StrCmp $DISABLESPLASHSCREEN "true" GetPassedParameters
;=== Show the splash screen before processing the files
InitPluginsDir
File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
newadvsplash::show /NOUNLOAD /PASSIVE 1500 0 0 -1 /L $PLUGINSDIR\splash.jpg

and add ${ConfigRead} "$SETTINGSDIRECTORY\config.xml" ' ' +5
to the WriteSettings: section. This computer is awful slow so I can't try to compile and test it, but I think that this would be a start of a help.

Also, check your splash screen call against the call in one of the latest applications. At the very least, you don't need the passive call.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
So in other worlds start from scratch....

okay ill try to do so but i doubt ill be able to. Seeing im such a neew when it comes to these things. But like i always say never say never. so ill give it a shot and ill try to rewrite the nsi file.

Edit: i took a better look at what u said and i notice that now lol. but i dont exactly know where to add the ${ConfigRead} "$SETTINGSDIRECTORY\config.xml" ' ' +5

can u give me a specific place to put it and thanx for the help.

2 Edit: okay i tried adding that but when i tried to make the exe it still doesnt show the splash.jpg. ill keep messing around but if u could edit the nsi file for me and change them so i could compare and contrast the two. I would be very greatful seeing that i dont know what im doing at the moment lol. im sort of lost when i start looking at all the script.

Dalton M. Kadar

(Don't Mind Me I'm A Noob)

kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
is there anyone that can help me?

i really want to fix this error and i don't know how. i don't want OpenSonic Portable and Smart Pacman portable to be one of those apps that get forgotten for a year or so. Sad i put to much work into it already. I hope someone will be able to check the entire nsi file and figure out my problem. i have tried so many things and nothings working. Sad Its probably cuz i'm a noob and don't know what i'm doing.
Also thank you to all those who are putting up with me and trying to help. even with all the funny link mistakes that are actually quite funny. It cheers me up when i cant figure out what i'm doing lol. Biggrin i get lost in the nsi scripting all the time. i feel ill never be able to fully understand it. Biggrin

Dalton M. Kadar

(Don't Mind Me I'm A Noob)

OliverK
OliverK's picture
Offline
Last seen: 2 years 9 months ago
Developer
Joined: 2007-03-27 15:21
You'll get there. Hint:

You'll get there. Hint: Notepad++ or Geany or HMNIS Edit is very helpful.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
i think ill start from scratch again...

but i don't know if i will be able to get it to work but i will try

Dalton M. Kadar

(Don't Mind Me I'm A Noob)

OliverK
OliverK's picture
Offline
Last seen: 2 years 9 months ago
Developer
Joined: 2007-03-27 15:21
start

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

kadardalton
kadardalton's picture
Offline
Last seen: 12 years 8 months ago
Joined: 2007-02-24 09:20
k thanxs i took...

a look at this once but couldnt figure it out exactly. time for another try at it lol.

Dalton M. Kadar

(Don't Mind Me I'm A Noob)

Log in or register to post comments