You are here

Dos Box: -noconsole ?

13 posts / 0 new
Last post
Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Dos Box: -noconsole ?

Hi,
the non-portable version can be started without showing the console window. (command line option -noconsole)
Is this possible with the portable version too?
How to change the dosbox.conf or DosBoxPortable.ini?

Btw: In the DOSBox Portable 0.72 Revision 2 Help.html the link to the support page is corrupt. (404 error)

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
Get DosBoxPortab.ini from the

Get DosBoxPortab.ini from the other/source folder and copy it to DosBoxPortable folder (alongside the launcher file)

Open it and add the -noconsole to the additional parameters.

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

Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Hmmm...

there is only one line:
DisableSplashScreen=false
Nothing like additional parameters Sad

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
you're right.

you're right.

How are you at compiling?

If so, this version has the switch included

;Copyright (C) 2004-2008 John T. Haller

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

;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 NAME "DOSBoxPortable"
!define PORTABLEAPPNAME "DOSBox Portable"
!define APPNAME "DOSBox"
!define VER "1.5.6.0"
!define WEBSITE "PortableApps.com/DOSBoxPortable"

;=== 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 "John T. Haller"
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

;=== Includes
!include "FileFunc.nsh"
!insertmacro GetParameters
!include "MUI.nsh"

;=== 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 DISABLESPLASHSCREEN
Var MISSINGFILEORPATH
Var EXECSTRING

Section "Main"
	ReadINIStr $DISABLESPLASHSCREEN "$EXEDIR\${NAME}.ini" "${NAME}" "DisableSplashScreen"

	IfFileExists "$EXEDIR\App\DOSBox\DOSBox.exe" SplashScreen
		;=== Program executable not where expected
		StrCpy $MISSINGFILEORPATH "$EXEDIR\App\DOSBox\DOSBox.exe"
		MessageBox MB_OK|MB_ICONEXCLAMATION `$(LauncherFileNotFound)`
		Abort
	
	SplashScreen:
		StrCmp $DISABLESPLASHSCREEN "true" SkipSplash
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
			newadvsplash::show /NOUNLOAD 1200 0 0 -1 /L $PLUGINSDIR\splash.jpg
			
	SkipSplash:
		IfFileExists '$EXEDIR\Data\settings\DOSBox.conf' GetParameters
			CreateDirectory '$EXEDIR\Data\settings'
			CopyFiles /SILENT '$EXEDIR\App\DefaultData\settings\DOSBox.conf' '$EXEDIR\Data\settings'

	GetParameters:
		${GetParameters} $0
		StrCmp "'$0'" "''" "" LaunchProgramParameters
			StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" -noconsole -conf "$EXEDIR\Data\settings\DOSBox.conf"`
			Goto LaunchNow
		
	LaunchProgramParameters:
		StrCpy $1 $0 5
		StrCmp $1 "-conf" LaunchProgramOnlyParameters
			StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" -noconsole -conf "$EXEDIR\Data\settings\DOSBox.conf" $0`
			Goto LaunchNow
	
	LaunchProgramOnlyParameters:
		StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" $0`
	
	LaunchNow:
		SetOutPath "$EXEDIR\App\DOSBox"
		Exec $EXECSTRING
		newadvsplash::stop /WAIT
SectionEnd

If you don't want to compile (don't be afraid to say) let me know.

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

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
@JohnTHaller ;Copyright (C)

@JohnTHaller

;Copyright (C) 2004-2008 John T. Haller

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

;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 NAME "DOSBoxPortable"
!define PORTABLEAPPNAME "DOSBox Portable"
!define APPNAME "DOSBox"
!define VER "1.5.6.0"
!define WEBSITE "PortableApps.com/DOSBoxPortable"

;=== 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 "John T. Haller"
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

;=== Includes
!include "FileFunc.nsh"
!insertmacro GetParameters
!include "MUI.nsh"

;=== 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 DISABLESPLASHSCREEN
Var MISSINGFILEORPATH
Var EXECSTRING
Var ADDITIONALPARAMETERS

Section "Main"
	ReadINIStr $DISABLESPLASHSCREEN "$EXEDIR\${NAME}.ini" "${NAME}" "DisableSplashScreen"
        ReadINIStr $ADDITIONALPARAMETERS "$EXEDIR\${NAME}.ini" "${NAME}" "AdditionalParameters"

	IfFileExists "$EXEDIR\App\DOSBox\DOSBox.exe" SplashScreen
		;=== Program executable not where expected
		StrCpy $MISSINGFILEORPATH "$EXEDIR\App\DOSBox\DOSBox.exe"
		MessageBox MB_OK|MB_ICONEXCLAMATION `$(LauncherFileNotFound)`
		Abort
	
	SplashScreen:
		StrCmp $DISABLESPLASHSCREEN "true" SkipSplash
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
			newadvsplash::show /NOUNLOAD 1200 0 0 -1 /L $PLUGINSDIR\splash.jpg
			
	SkipSplash:
		IfFileExists '$EXEDIR\Data\settings\DOSBox.conf' GetParameters
			CreateDirectory '$EXEDIR\Data\settings'
			CopyFiles /SILENT '$EXEDIR\App\DefaultData\settings\DOSBox.conf' '$EXEDIR\Data\settings'

	GetParameters:
		${GetParameters} $0
		StrCmp "'$0'" "''" "" LaunchProgramParameters
			StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" -conf "$EXEDIR\Data\settings\DOSBox.conf"`
			Goto LaunchNow
		
	LaunchProgramParameters:
		StrCpy $1 $0 5
		StrCmp $1 "-conf" LaunchProgramOnlyParameters
			StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" -conf "$EXEDIR\Data\settings\DOSBox.conf" $0`
			Goto LaunchNow
	
	LaunchProgramOnlyParameters:
		StrCpy $EXECSTRING `"$EXEDIR\App\DOSBox\DOSBox.exe" $0`
	
	LaunchNow:
		SetOutPath "$EXEDIR\App\DOSBox"
		Exec '$EXECSTRING $ADDITIONALPARAMETERS'
		newadvsplash::stop /WAIT
SectionEnd

This is an updated launcher that uses
[DosBoxPortable]
AdditonalParameters=

To pass addtional commands.

Are you interested in me doing up a new package, updating to the latest installer, etc?

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

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 35 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Thanks, but

Thanks, but not right now. It's not enough of an update to warrant a revision outside the cycle of DOSBox's releases. If there's no new DOSBox by the time the PortableApps.com Installer is 1.0 (we're getting close) I'll post a new release with AdditionalParameters added.

Sometimes, the impossible can become possible, if you're awesome!

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
Fair Enough. Just figured

Fair Enough. Just figured I'd offer- in case you didn't want to mess with it.

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

Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Thanks very much, Oliver.

Thanks very much, Oliver.
I think i can live with the console window for now. I don't want to recompile the launcher, because i haven't any compiling experience. I will wait for the next official release. This is no problem for me.
Thanks again.

lwc
Offline
Last seen: 1 week 6 days ago
Translator
Joined: 2006-04-26 06:35
No console=less portability

Do you realize that this parameter could also be called "portable mode"? When it's turned off, there's a price to pay - 2 files that DOSBOx writes to the active folder and never deletes them, which means soon enough your game folders would all contain these files.

If you've downloaded the portable version of DOSBox, despite the fact that DOSBox itself is portable in everything except putting itself in the start menu and in the uninstallations' list, obviously portability is important to you. But if you disable the console, you'd get a less portable version. That's a little ironic.

Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Why less portability?

Ok, I'm not a dev, but i've learned a few things from portableapps.com. The launcher takes care of registry keys, files, folders, enviroment variables...
If the parameter -noconsole is used, the output will be redirected to 2 files (stdout.txt and stderr.txt). Why not change the launcher, so that it delete/move these 2 files? Shouldn't be a problem for the devs! They are really good here Smile

lwc
Offline
Last seen: 1 week 6 days ago
Translator
Joined: 2006-04-26 06:35
Because they're created in the active folder

Can the launcher be programmed in advance for files that are created anywhere you launch DOSBox in (e.g. c:\game1\, c:\games\game4, etc.)?

Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
I don't know

But I always launch DosBox in X:\PortableApps\DOSBoxPortable. I'm not sure but I guess that the 2 files are created somewhere in the DOSBox program folder and not in the mounted game folders.
Furthermore if the 2 files are written into the game folders, they will be on my portable drive too, because my game folders are on the same drive (e.g. X:\DOSGames\game1, X:\DOSGames\game2, ...)

Therefore "-noconsole" not causes "less portability".

Bart.S
Offline
Last seen: 5 months 3 weeks ago
Developer
Joined: 2008-07-23 07:56
Information

I have recompiled the launcher using OliverK's code. It works perfect, the annoying console window does't appear anymore. Thanks again Oliver!
The 2 above mentioned files will be created in App\DOSBox, if the -noconsole parameter is used. Therefore there is no need to change the launcher more to handle these files.

John, this is a feature request for the next release. I have installed manually the german language pack. It includes the following files.

  • App\DOSBox\deutsch.lng
  • App\DOSBox\deutsch.txt
  • App\DOSBox\README_de.txt
  • App\DOSBox\zmbv\README_de.txt

Is it possible to preserve these files when updating? Maybe you can add some generic code to the PortableApps.comInstallerConfig.nsh to preserve the files of all translations.
But don't hurry, I have all that I want now. Smile

Log in or register to post comments