The -i and -p switches aren't required anymore on installed and portable versions

This commit is contained in:
Jose Manuel Delicado 2016-01-19 19:52:09 +01:00
parent 112391afeb
commit c830d4b5b4
5 changed files with 9 additions and 13 deletions

View File

@ -1,7 +1,7 @@
[Launch] [Launch]
ProgramExecutable=TWBlue\TWBlue.exe ProgramExecutable=TWBlue\TWBlue.exe
ProgramExecutable64=TWBlue64\TWBlue.exe ProgramExecutable64=TWBlue64\TWBlue.exe
CommandLineArguments=-p -d "%PAL:DataDir%" CommandLineArguments=-d "%PAL:DataDir%"
SinglePortableAppInstance=true SinglePortableAppInstance=true
MinOS=XP MinOS=XP
SingleAppInstance=false SingleAppInstance=false

View File

@ -26,7 +26,6 @@ var StartMenuFolder
!define MUI_FINISHPAGE_LINK "Visit TWBlue website" !define MUI_FINISHPAGE_LINK "Visit TWBlue website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.es" !define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.es"
!define MUI_FINISHPAGE_RUN "$INSTDIR\TWBlue.exe" !define MUI_FINISHPAGE_RUN "$INSTDIR\TWBlue.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS "-i"
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_INSTFILES
@ -58,10 +57,10 @@ File /r TWBlue64\*
${Else} ${Else}
File /r TWBlue\* File /r TWBlue\*
${EndIf} ${EndIf}
CreateShortCut "$DESKTOP\TWBlue.lnk" "$INSTDIR\TWBlue.exe" "-i" CreateShortCut "$DESKTOP\TWBlue.lnk" "$INSTDIR\TWBlue.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu !insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue.lnk" "$INSTDIR\TWBlue.exe" "-i" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue.lnk" "$INSTDIR\TWBlue.exe"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue on the web.lnk" "http://twblue.es" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue on the web.lnk" "http://twblue.es"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END !insertmacro MUI_STARTMENU_WRITE_END

View File

@ -6,13 +6,7 @@ import application
log = logging.getLogger("commandlineLauncher") log = logging.getLogger("commandlineLauncher")
parser = argparse.ArgumentParser(description=application.name+" command line launcher") parser = argparse.ArgumentParser(description=application.name+" command line launcher")
group = parser.add_mutually_exclusive_group()
group.add_argument("-p", "--portable", help="Use " + application.name + " as a portable application.", action="store_true", default=True)
group.add_argument("-i", "--installed", help="Use " + application.name + " as an installed application. Config files will be saved in the user data directory", action="store_true")
parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where " + application.name + " saves userdata.") parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where " + application.name + " saves userdata.")
args = parser.parse_args() args = parser.parse_args()
log.debug("Starting " + application.name + " with the following arguments: installed = %s, portable = %s and directory = %s" % (args.installed, args.portable, args.directory)) log.debug("Starting " + application.name + " with the following arguments: directory = %s" % (args.directory))
if args.installed == True: paths.mode = "installed" if args.directory != None: paths.directory = args.directory
elif args.portable == True:
paths.mode = "portable"
if args.directory != None: paths.directory = args.directory

View File

@ -32,6 +32,9 @@ if system == "Windows":
from update import updater from update import updater
stdout_temp=sys.stdout stdout_temp=sys.stdout
stderr_temp=sys.stderr stderr_temp=sys.stderr
#check if TWBlue is installed
if os.path.exists(paths.app_path(u"Uninstall.exe")):
paths.mode="installed"
#if it's a binary version #if it's a binary version
if hasattr(sys, 'frozen'): if hasattr(sys, 'frozen'):
sys.stderr = open(paths.logs_path("stderr.log"), 'w') sys.stderr = open(paths.logs_path("stderr.log"), 'w')

View File

@ -7,7 +7,7 @@ from platform_utils import paths as paths_
from functools import wraps from functools import wraps
mode = None mode = "portable"
directory = None directory = None
log = logging.getLogger("paths") log = logging.getLogger("paths")