diff --git a/configure.py b/configure.py index f4367694..9276a613 100644 --- a/configure.py +++ b/configure.py @@ -128,6 +128,9 @@ def clean(): safe_remove(os.path.join("SuperBuild", "src")) safe_remove(os.path.join("SuperBuild", "install")) +def dist(): + # D:\Program Files (x86)\Inno Setup 6 + run("compil32 /cc \"innosetup.iss\") if args.action == 'build': build() diff --git a/console.bat b/console.bat index 6d741f83..d879be31 100644 --- a/console.bat +++ b/console.bat @@ -3,6 +3,6 @@ setlocal call win32env.bat -start "ODM Console" cmd +start "ODM Console" cmd /k "echo ____________________________ && echo / ____ _____ __ __ \ && echo ^| / __ \ ^| __ \ ^| \/ ^| ^| && echo ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| \ / ^| ^| && echo ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| ^|\/^| ^| ^| && echo ^| ^| ^|__^| ^| ^| ^|__^| ^| ^| ^| ^| ^| ^| && echo ^| \____/ ^|_____/ ^|_^| ^|_^| ^| && echo \____________________________/ && @echo off && FOR /F %%i in (VERSION) do echo version: %%i && @echo on && echo. && run --help endlocal diff --git a/innosetup.iss b/innosetup.iss new file mode 100644 index 00000000..6a3a1627 --- /dev/null +++ b/innosetup.iss @@ -0,0 +1,59 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "ODM" +#define VerFile FileOpen("VERSION") +#define MyAppVersion FileRead(VerFile) +#expr FileClose(VerFile) +#undef VerFile +#define MyAppPublisher "OpenDroneMap" +#define MyAppURL "https://opendronemap.org" + +#define InnoRoot "D:\webodm-lightning" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{E75D901B-A57E-4FDC-9F2E-36B0CF8DE895} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\WebODM Lightning +DefaultGroupName={#MyAppName} +AllowNoIcons=yes +LicenseFile=LICENSE +OutputDir=dist +OutputBaseFilename=ODM_Setup_{#MyAppVersion} +Compression=lzma +SolidCompression=yes +ArchitecturesAllowed=x64 +SignTool=signtool +PrivilegesRequired=lowest +UsePreviousAppDir=no +;SetupIconFile=setup.ico + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] +Source: "contrib"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "licenses"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "opendm"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "stages"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "stages"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "venv"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Icons] +Name: {group}\ODM Console; Filename: "{app}\console.bat"; WorkingDir: "{app}" +Name: "{userdesktop}\ODM Console"; Filename: "{app}\console.bat"; WorkingDir: "{app}"; Tasks: desktopicon + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Run] +Filename: {app}\console; Description: {cm:LaunchProgram,ODM Console}; Flags: nowait postinstall skipifsilent \ No newline at end of file diff --git a/opendm/config.py b/opendm/config.py index 8928525f..0569fb45 100755 --- a/opendm/config.py +++ b/opendm/config.py @@ -17,13 +17,6 @@ with open(os.path.join(context.root_path, 'VERSION')) as version_file: __version__ = version_file.read().strip() -def alphanumeric_string(string): - import re - if re.match('^[a-zA-Z0-9_-]+$', string) is None: - msg = '{0} is not a valid name. Must use alphanumeric characters.'.format(string) - raise argparse.ArgumentTypeError(msg) - return string - def path_or_json_string(string): try: return io.path_or_json_string_to_dict(string) @@ -68,9 +61,14 @@ def config(argv=None, parser=None): if args is not None and argv is None: return args + if sys.platform == 'win32': + usage_bin = 'run' + else: + usage_bin = 'run.sh' + if parser is None: - parser = SettingsParser(description='ODM', - usage='%(prog)s [options] ', + parser = SettingsParser(description='ODM is a command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images.', + usage='%s [options] ' % usage_bin, yaml_file=open(context.settings_path)) parser.add_argument('--project-path', @@ -78,9 +76,9 @@ def config(argv=None, parser=None): action=StoreValue, help='Path to the project folder. Your project folder should contain subfolders for each dataset. Each dataset should have an "images" folder.') parser.add_argument('name', - metavar='', + metavar='', action=StoreValue, - type=alphanumeric_string, + type=str, default='code', nargs='?', help='Name of dataset (i.e subfolder name within project folder). Default: %(default)s')