You are here

My Xilisoft Video Converter won't startup, anyone can help me please....

4 posts / 0 new
Last post
Dark Soul
Offline
Last seen: 16 years 8 months ago
Joined: 2008-05-26 23:31
My Xilisoft Video Converter won't startup, anyone can help me please....

I have create a launcher to make my xilisoft video converter become portable, it success copy the registry file needed, but when i execute the launcher, my Xilisoft video converter won't startup. It's just execute the videoenc.exe after that it's automatically close it. Is anyone can help me please...
(this is my email, D4rk_SouL86(at)yahoo(dot)com)

This is the template, is there anything wrong with it?

; **************************************************************************
; Name: Xilisoft Video Converter Portable v3.1.49 
; **************************************************************************
!define AUTHOR "Dark Soul"
!define APP "Xilisoft"
!define VER "3.1.49.0"
!define EXE "videoenc.exe"
!define PNAME "${App}Portable"
!define ICON "${PNAME}.ico"
!define REGKEYS "HKEY_LOCAL_MACHINE\SOFTWARE\RealDSF||HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Xilisoft Video Converter||HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.||HKEY_CURRENT_USER\Software\Xilisoft||HKEY_CLASSES_ROOT\CLSID\{E21BE468-5C18-43EB-B0CC-DB93A847D769}||HKEY_CLASSES_ROOT\CLSID\{941A4793-A705-4312-8DFC-C11CA05F397E}||HKEY_CLASSES_ROOT\CLSID\{765035B3-5944-4A94-806B-20EE3415F26F}||HKEY_CLASSES_ROOT\CLSID\{238D0F23-5DC9-45A6-9BE2-666160C324DD}"
!define INI "${PNAME}.ini"

; **************************************************************************
!include "Registry.nsh"
!include "WordFunc.nsh"
!insertmacro "WordFind"
!include "FileFunc.nsh"
!insertmacro "GetParameters"

; **************************************************************************
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True

; **************************************************************************
Var ACTION
Var ACTIONDIRECTORY
Var ACTIONPARAMETERS
Var SPLASHSCREEN
Var PROGRAMEXE
Var PROGRAMDIR
Var PROGRAMPARMS
Var DATADIR
Var INIFILE
Var SECONDLAUNCH

; **************************************************************************
Name "${APP} Portable"
!ifdef ICON
	Icon "${ICON}"
!endif
Caption "${APP} Portable - ${VER}"
OutFile "Xilisoft Video Converter Portable v3.1.49.exe"

; **************************************************************************
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
VIProductVersion "${Ver}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Xilisoft Video Converter Portable v3.1.49"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Allow Video Converter to be run from a removeable drive."
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Xilisoft Video Converter Portable v3.1.49"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "${PNAME}.exe"

; **************************************************************************
Function Init
FunctionEnd

; **************************************************************************
Function CleanUp
FunctionEnd

; **************************************************************************
Function InitVariables
	; --------------------------------------------------------------------------
	; Check whether an INI file exists, set variable pointing to it
	; --------------------------------------------------------------------------
	IfFileExists "$EXEDIR\${INI}" "" CheckPortableINI
		StrCpy "$INIFILE" "$EXEDIR\${INI}"
		Goto ReadINIFile
	CheckPortableINI:
		IfFileExists "$EXEDIR\${PNAME}\${INI}" "" CheckPortableAppsINI
			StrCpy "$INIFILE" "$EXEDIR\${PNAME}\${INI}"
			Goto ReadINIFile
	CheckPortableAppsINI:
		IfFileExists "$EXEDIR\PortableApps\${PNAME}\${INI}" "" CheckAppsINI
			StrCpy "$INIFILE" "$EXEDIR\PortableApps\${PNAME}\${INI}"
			Goto ReadINIFile
	CheckAppsINI:
		IfFileExists "$EXEDIR\Apps\${PNAME}\${INI}" "" CheckDataINI
			StrCpy "$INIFILE" "$EXEDIR\Apps\${PNAME}\${INI}"
			Goto ReadINIFile
	CheckDataINI:
		IfFileExists "$EXEDIR\Data\${PNAME}\${INI}" "" NoINIFile
			StrCpy "$INIFILE" "$EXEDIR\Data\${PNAME}\${INI}"
			Goto ReadINIFile	
	Goto NoINIFile
	; --------------------------------------------------------------------------
	; Read content of the INI file
	; --------------------------------------------------------------------------
	ReadINIFile:
		ReadINIStr $0 "$INIFILE" "${PNAME}" "ProgramDirectory"
		StrCmp $0 "" NoINIFile ; if emtpy retrieve correct setting
		StrCpy "$PROGRAMDIR" "$EXEDIR\$0"
		ReadINIStr $0 "$INIFILE" "${PNAME}" "DataDirectory"
		StrCmp $0 "" NoINIFile ; if empty retrieve correct setting
		StrCpy "$DATADIR" "$EXEDIR\$0"
		ReadINIStr $0 "$INIFILE" "${PNAME}" "ProgramExecutable"
		StrCpy "$PROGRAMEXE" "$0"
		StrCmp $0 "" "" Splash
		StrCpy "$PROGRAMEXE" "${EXE}"
		Splash:
			ReadINIStr $0 "$INIFILE" "${PNAME}" "SplashScreen"
			StrCpy "$SPLASHSCREEN" "$0"
			StrCmp "$SPLASHSCREEN" "" "" ProgramParameters
			StrCpy "$SPLASHSCREEN" "enabled"
		ProgramParameters:
			ReadINIStr $0 "$INIFILE" "${PNAME}" "ProgramParameters"
			StrCpy "$PROGRAMPARMS" "$0"
		Goto InitVarEnd
	NoINIFile:
		; --------------------------------------------------------------------------
		; Set default values for variables
		; --------------------------------------------------------------------------
		StrCpy "$PROGRAMEXE" "${EXE}"
		StrCpy "$PROGRAMPARMS" ""
		StrCpy "$SPLASHSCREEN" "enabled"
		; --------------------------------------------------------------------------
		; Check which directory configuration is used and set variables accordingly
		; --------------------------------------------------------------------------
		IfFileExists "$EXEDIR\App\${APP}\$PROGRAMEXE" "" CheckPortableDIR
			StrCpy "$PROGRAMDIR" "$EXEDIR\App\${APP}"
			StrCpy "$DATADIR" "$EXEDIR\Data"
			Goto InitVarEnd
		CheckPortableDIR:
		IfFileExists "$EXEDIR\${PNAME}\App\${APP}\$PROGRAMEXE" "" CheckPortableAppsDIR
			StrCpy "$PROGRAMDIR" "$EXEDIR\${PNAME}\App\${APP}"
			StrCpy "$DATADIR" "$EXEDIR\${PNAME}\Data"
			Goto InitVarEnd
		CheckPortableAppsDIR:
		IfFileExists "$EXEDIR\PortableApps\${PNAME}\App\${APP}\$PROGRAMEXE" "" CheckAppsDIR
			StrCpy "$PROGRAMDIR" "$EXEDIR\PortableApps\${PNAME}\App\${APP}"
			StrCpy "$DATADIR" "$EXEDIR\PortableApps\${PNAME}\Data"
			Goto InitVarEnd
		CheckAppsDIR:
		IfFileExists "$EXEDIR\Apps\${PNAME}\${APP}\$PROGRAMEXE" "" NoDIR
			StrCpy "$PROGRAMDIR" "$EXEDIR\Apps\${PNAME}\${APP}"
			StrCpy "$DATADIR" "$EXEDIR\Data\${PNAME}"
			Goto InitVarEnd
	NoDIR:
		; --------------------------------------------------------------------------
		; No allowed pathconfiguration was found
		; --------------------------------------------------------------------------
		MessageBox MB_OK|MB_ICONEXCLAMATION `$PROGRAMEXE was not found.  Please check your configuration`
		Abort
	InitVarEnd:
FunctionEnd

; **************************************************************************
Function DoAction
	StrCmp "$ACTIONPARAMETERS" "" AfterLoop
	StrCpy "$R8" "0" ; reset counter
	StrCpy "$R2" "$ACTION" 6 #
	StrCmp "$R2" "Backup" "" GoOn
	IfFileExists "$ACTIONDIRECTORY\*.*" GoOn
		CreateDirectory $ACTIONDIRECTORY
	GoOn:
	StrCpy "$R0" "$ACTIONPARAMETERS"
	Loop:
		; --------------------------------------------------------------------------
		; Get single parameter out of list
		; --------------------------------------------------------------------------
		StrCmp "$R0" "" AfterLoop
		IntOp $R8 $R8 + 1
		${WordFind} "$R0" "||" "+01" $R9
		${WordFind} "$R0" "||" "+02*}"  $R0
		StrCmp "$R0" "$R9" LastLoop
		Goto DoWork
		LastLoop:
		StrCpy "$R0" ""
		; --------------------------------------------------------------------------
		;Decide what to do with parameter
		; --------------------------------------------------------------------------
		DoWork:
		StrCpy "$R2" "$ACTION" "" -4 #
		!ifdef REGKEYS
			StrCmp "$R2" "Keys" DoWorkRegistry
		!endif
		!ifdef SETTINGSFILES
			StrCmp "$R2" "File" DoWorkFiles
		!endif
		!ifdef SETTINGSDIRS
			StrCmp "$R2" "Dirs" DoWorkDirectory
		!endif
		Goto Continue
		; --------------------------------------------------------------------------
		; Do action on registry keys
		; --------------------------------------------------------------------------
		!ifdef REGKEYS
			DoWorkRegistry:
				StrCmp "$ACTION" "BackupKeys" BackupRegistryKey
				StrCmp "$ACTION" "RestoreKeys" RestoreRegistryKey
				StrCmp "$ACTION" "DeleteKeys" DeleteRegistryKey
				Goto Continue
			BackupRegistryKey:
				${registry::KeyExists} "$R9" $R7
				StrCmp "$R7" "0" 0 Continue
				${registry::SaveKey} "$R9" "$ACTIONDIRECTORY\RegKey$R8.reg" "/G=1" $R7
				Sleep 50
				Goto Continue
			RestoreRegistryKey:
				IfFileExists "$ACTIONDIRECTORY\RegKey$R8.reg" 0 Continue
				${registry::RestoreKey} "$ACTIONDIRECTORY\RegKey$R8.reg" $R7
				Sleep 50
				Goto Continue
			DeleteRegistryKey:
				${registry::DeleteKey} "$R9" $R7
				Sleep 50
				Goto Continue
		!endif
		; --------------------------------------------------------------------------
		; Do action on files
		; --------------------------------------------------------------------------
		!ifdef SETTINGSFILES
			DoWorkFiles:
				StrCmp "$ACTION" "BackupFile" BackupFile
				StrCmp "$ACTION" "RestoreFile" RestoreFile
				StrCmp "$ACTION" "DeleteFile" DeleteFile
			BackupFile:
				IfFileExists "$R9" 0 Continue
				CopyFiles "$R9" "$ACTIONDIRECTORY\File$R8.dat"
				Goto Continue
			RestoreFile:
				IfFileExists "$ACTIONDIRECTORY\File$R8.dat" 0 Continue
				CopyFiles "$ACTIONDIRECTORY\File$R8.dat" "$R9"
				Goto Continue
			DeleteFile:
				Delete "$R9"
				Goto Continue
		!endif
		; --------------------------------------------------------------------------
		; Do action on directories
		; --------------------------------------------------------------------------
		!ifdef SETTINGSDIRS
			DoWorkDirectory:
				StrCmp "$ACTION" "BackupDirs" BackupDirectory
				StrCmp "$ACTION" "RestoreDirs" RestoreDirectory
				StrCmp "$ACTION" "DeleteDirs" DeleteDirectory
			BackupDirectory:
				IfFileExists "$R9\*.*" 0 Continue
				IfFileExists "$ACTIONDIRECTORY\Dir$R8.dat" +2 0
				CreateDirectory "$ACTIONDIRECTORY\Dir$R8.dat"
				CopyFiles "$R9\*.*" "$ACTIONDIRECTORY\Dir$R8.dat"
				Goto Continue
			RestoreDirectory:
				IfFileExists "$ACTIONDIRECTORY\Dir$R8.dat\*.*" 0 Continue
				IfFileExists "$R9\*.*" +2 0
				CreateDirectory "$R9"
				CopyFiles "$ACTIONDIRECTORY\Dir$R8.dat\*.*" "$R9"
				Goto Continue
			DeleteDirectory:
				RMDir "/r" "$R9"
				Goto Continue
		!endif
		; --------------------------------------------------------------------------
		; End of Loop
		; --------------------------------------------------------------------------
		Continue:
		Goto Loop
	AfterLoop:
FunctionEnd

; **************************************************************************
Function CheckEXE
	IfFileExists "$PROGRAMDIR\$PROGRAMEXE" FoundEXE
		MessageBox MB_OK|MB_ICONEXCLAMATION `$PROGRAMEXE was not found.  Please check your configuration!`
		Abort
	FoundEXE:
		FindProcDLL::FindProc "$PROGRAMEXE"                 
		StrCmp $R0 "1" "" EndEXE
			StrCpy $SECONDLAUNCH "true"
	EndEXE:
FunctionEnd

; **************************************************************************
Section "Main"
	; --------------------------------------------------------------------------
	; Initialize variables, read INI etc.
	; --------------------------------------------------------------------------
	Call InitVariables
	; --------------------------------------------------------------------------
	; Do some EXE checking
	; --------------------------------------------------------------------------
	Call CheckEXE
	; --------------------------------------------------------------------------
	; Display Splashscreen when available
	; --------------------------------------------------------------------------
	!ifdef SPLASHIMAGE
		StrCmp "$SPLASHSCREEN" "enabled" 0 NoSplash
		InitPluginsDir
		File /oname=$PLUGINSDIR\splash.jpg "${SPLASHIMAGE}"	
		newadvsplash::show /NOUNLOAD 2500 200 200 -1 /L $PLUGINSDIR\splash.jpg
		NoSplash:
	!endif
	StrCmp $SECONDLAUNCH "true" SimplyStartProgram
	; --------------------------------------------------------------------------
	; Backup existing, replace with saved registry keys
	; --------------------------------------------------------------------------
	!ifdef REGKEYS
		StrCpy "$ACTIONPARAMETERS" "${REGKEYS}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\RegistryBackup"
		StrCpy "$ACTION" "BackupKeys"
		Call DoAction
;		StrCpy "$ACTION" "DeleteKeys"
;		Call DoAction
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Registry"
		StrCpy "$ACTION" "RestoreKeys"
		Call DoAction
	!endif
	; --------------------------------------------------------------------------
	; Backup existing, replace with saved settings files
	; --------------------------------------------------------------------------
	!ifdef SETTINGSFILES
		StrCpy "$ACTIONPARAMETERS" "${SETTINGSFILES}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\SettingsBackup"
		StrCpy "$ACTION" "BackupFile"
		Call DoAction
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Settings"
		StrCpy "$ACTION" "RestoreFile"
		Call DoAction
	!endif
	; --------------------------------------------------------------------------
	; Backup existing settings directories
	; --------------------------------------------------------------------------
	!ifdef SETTINGSDIRS
		StrCpy "$ACTIONPARAMETERS" "${SETTINGSDIRS}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\SettingsBackup"
		StrCpy "$ACTION" "BackupDirs"
		Call DoAction
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Settings"
		StrCpy "$ACTION" "RestoreDirs"
		Call DoAction
	!endif

	Call Init
	; --------------------------------------------------------------------------
	; Start program
	; --------------------------------------------------------------------------
	${GetParameters} $R0
	ExecWait "$PROGRAMDIR\$PROGRAMEXE $PROGRAMPARMS $R0"

	Call CleanUp
	; --------------------------------------------------------------------------
	; backup and restore or clean up settings directories
	; --------------------------------------------------------------------------
	!ifdef SETTINGSDIRS
		StrCpy "$ACTIONPARAMETERS" "${SETTINGSDIRS}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Settings"
		StrCpy "$ACTION" "BackupDirs"
		Call DoAction
		StrCpy "$ACTION" "DeleteDirs"
		Call DoAction
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\SettingsBackup"
		StrCpy "$ACTION" "RestoreDirs"
		Call DoAction
	!endif
	; --------------------------------------------------------------------------
	; backup and restore or clean up settings files
	; --------------------------------------------------------------------------
	!ifdef SETTINGSFILES
		StrCpy "$ACTIONPARAMETERS" "${SETTINGSFILES}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Settings"
		StrCpy "$ACTION" "BackupFile"
		Call DoAction
		StrCpy "$ACTION" "DeleteFile"
		Call DoAction
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\SettingsBackup"
		StrCpy "$ACTION" "RestoreFile"
		Call DoAction
	!endif
	; --------------------------------------------------------------------------
	; backup and restore or clean up registry keys
	; --------------------------------------------------------------------------
	!ifdef REGKEYS
		StrCpy "$ACTIONPARAMETERS" "${REGKEYS}"
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\Registry"
		StrCpy "$ACTION" "BackupKeys"
		Call DoAction
		StrCpy "$ACTION" "DeleteKeys"
		Call DoAction
		sleep 500
		StrCpy "$ACTIONDIRECTORY" "$DATADIR\RegistryBackup"
		StrCpy "$ACTION" "RestoreKeys"
		Call DoAction
		sleep 1000
	!endif
	${registry::Unload}
	; --------------------------------------------------------------------------
	; remove saved backups
	; --------------------------------------------------------------------------
	RMDir "/r" "$DATADIR\SettingsBackup"
	RMDir "/r" "$DATADIR\RegistryBackup"
	Goto EndOfCode
	; --------------------------------------------------------------------------
	; run application directly without doing anything else, as it is already running
	; --------------------------------------------------------------------------
	SimplyStartProgram:
		${GetParameters} $R0
		Exec "$PROGRAMDIR\$PROGRAMEXE $PROGRAMPARMS $R0"
		${registry::Unload}
	EndOfCode:
SectionEnd

[Double post deleted, pre tags added and email hidden by moderator SL]

Travis Carrico
Offline
Last seen: 16 years 2 months ago
Developer
Joined: 2006-10-22 00:30
well i didn't really trace

well i didn't really trace through your code but assuming you have everything right then a common reason for it not launching right would be that for some apps you need to add
SetOutPath "$PROGRAMDIR"
before your Exec line to set it's working directory

Dark Soul
Offline
Last seen: 16 years 8 months ago
Joined: 2008-05-26 23:31
Thank's

Thank's so much, it was work on my launcher

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 7 months ago
Joined: 2007-04-15 21:08
Dark Soul: welcome to

Dark Soul: welcome to PortableApps.com!

It's good to see more people working on more portable apps, but requests about these sorts of things should really go in the Portable App Development forum. Could you (or a moderator) please move it there?

And once again, welcome to the PortableApps.com community.

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

Log in or register to post comments