├── NEWS ├── os ├── debian ├── compat ├── source │ └── format ├── docs ├── Makefile.am ├── rules ├── changelog ├── control ├── copyright └── rules.old ├── src ├── locale │ ├── fr │ │ ├── Makefile.am │ │ └── LC_MESSAGES │ │ │ ├── Makefile.am │ │ │ └── woeusb.po │ ├── zh_TW │ │ ├── Makefile.am │ │ └── LC_MESSAGES │ │ │ ├── Makefile.am │ │ │ └── woeusb.po │ ├── Makefile.am │ └── woeusb.pot ├── win32 │ ├── Makefile.am │ ├── icon.ico │ └── winProg.manifest ├── data │ ├── icon.png │ ├── c501-logo.png │ ├── woeusb-logo.png │ ├── Makefile.am │ ├── listDvdDrive │ └── listUsb ├── linux-menu │ ├── woeusbgui-icon.png │ ├── Makefile.am │ └── woeusbgui.desktop ├── AppConfig.hpp ├── woeusbgui.1 ├── installDll.sh ├── rc.rc ├── Makefile.am ├── processManager.hpp ├── findFile.hpp ├── MyException.cpp ├── woeusbgui.cbp ├── App.hpp ├── strWxStdConv.cpp ├── nbStrConvert.hpp ├── MainFrame.hpp ├── findFile.cpp ├── MainPanel.hpp ├── DialogAbout.hpp ├── processManager.cpp ├── MainFrame.cpp ├── woeusb.1 ├── MyException.hpp ├── App.cpp ├── DialogAbout.cpp ├── strWxStdConv.hpp └── MainPanel.cpp ├── innoSetup ├── Makefile.am └── setup.iss ├── AUTHORS ├── dev ├── woeusb-screenshot.png ├── woeusbgui-screenshot.png ├── woeusb-screenshot.thumbnail.png ├── woeusbgui-screenshot.thumbnail.png └── README.markdown ├── .gitattributes ├── .gitconfig ├── .github ├── The source code archives provided here is NOT supported, please use git-clone instead └── issue_template.md ├── ChangeLog ├── Makefile.am ├── README.upstream ├── .gitignore ├── configure.ac ├── .travis.yml ├── polkit └── com.github.slacka.woeusb.policy ├── filters ├── clean-version.bash └── smudge-version.bash ├── README.md ├── CONTRIBUTING.md ├── setup-development-environment.bash ├── acinclude.m4 └── COPYING /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /os: -------------------------------------------------------------------------------- 1 | deb; 2 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /src/locale/fr/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = LC_MESSAGES 2 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | NEWS 2 | README.md 3 | README.upstream 4 | -------------------------------------------------------------------------------- /innoSetup/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = $(srcdir)/setup.iss 2 | -------------------------------------------------------------------------------- /src/locale/zh_TW/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = LC_MESSAGES 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Colin GILLE / congelli501 2 | -------------------------------------------------------------------------------- /src/win32/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = $(srcdir)/icon.ico $(srcdir)/winProg.manifest 3 | -------------------------------------------------------------------------------- /src/data/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/src/data/icon.png -------------------------------------------------------------------------------- /src/win32/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/src/win32/icon.ico -------------------------------------------------------------------------------- /src/data/c501-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/src/data/c501-logo.png -------------------------------------------------------------------------------- /src/data/woeusb-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/src/data/woeusb-logo.png -------------------------------------------------------------------------------- /dev/woeusb-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/dev/woeusb-screenshot.png -------------------------------------------------------------------------------- /dev/woeusbgui-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/dev/woeusbgui-screenshot.png -------------------------------------------------------------------------------- /src/locale/Makefile.am: -------------------------------------------------------------------------------- 1 | # Il faut mettre les fichiers dans le sous dossier locale de share... 2 | SUBDIRS = fr zh_TW 3 | -------------------------------------------------------------------------------- /src/linux-menu/woeusbgui-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/src/linux-menu/woeusbgui-icon.png -------------------------------------------------------------------------------- /dev/woeusb-screenshot.thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/dev/woeusb-screenshot.thumbnail.png -------------------------------------------------------------------------------- /dev/woeusbgui-screenshot.thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WoeUSB/WoeUSB-frontend-wxgtk/HEAD/dev/woeusbgui-screenshot.thumbnail.png -------------------------------------------------------------------------------- /dev/README.markdown: -------------------------------------------------------------------------------- 1 | # dev: Stuffs That Are Specific to WoeUSB's Development Only 2 | These files should not be included into software build. 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | configure.ac filter=version 2 | debian/changelog filter=version 3 | src/woeusb filter=version 4 | src/woeusb.1 filter=version 5 | src/woeusbgui.1 filter=version 6 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | # Project-specific Git Configuration 2 | # DOC: man: git-config 3 | [filter "version"] 4 | clean = filters/clean-version.bash 5 | smudge = filters/smudge-version.bash 6 | -------------------------------------------------------------------------------- /.github/The source code archives provided here is NOT supported, please use git-clone instead: -------------------------------------------------------------------------------- 1 | This is a dummy file for package uploaders to resolve the undenyable GitHub Release source code archives. -------------------------------------------------------------------------------- /debian/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | $(srcdir)/changelog\ 3 | $(srcdir)/compat\ 4 | $(srcdir)/control\ 5 | $(srcdir)/copyright\ 6 | $(srcdir)/dirs\ 7 | $(srcdir)/docs\ 8 | $(srcdir)/rules 9 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2017-06-13 林博仁 2 | 3 | * We no longer use ChangeLog as we use Git as our VCS, please refer `git log` or refer Commits · slacka/WoeUSB for changelog of WoeUSB. 4 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | src\ 4 | innoSetup\ 5 | debian 6 | 7 | # M4 8 | 9 | ## Pour fichier COPYING 10 | pkgdocdir=$(prefix) 11 | 12 | if IS_MINGW 13 | pkgdoc_DATA = $(srcdir)/COPYING 14 | endif 15 | 16 | EXTRA_DIST = $(srcdir)/os 17 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | export DH_VERBOSE = 1 3 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 4 | export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 5 | export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 6 | 7 | %: 8 | dh $@ --with autoreconf 9 | -------------------------------------------------------------------------------- /src/locale/zh_TW/LC_MESSAGES/Makefile.am: -------------------------------------------------------------------------------- 1 | # Il faut mettre les fichiers dans le sous dossier locale/zh_TW/LC_MESSAGES de share... 2 | pkgdatadir=$(mypkgdatadir)/locale/zh_TW/LC_MESSAGES 3 | 4 | %.mo: %.po 5 | msgfmt -o $@ $< 6 | 7 | dist_pkgdata_DATA = $(srcdir)/woeusb.mo 8 | -------------------------------------------------------------------------------- /src/linux-menu/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | if ! IS_MINGW 3 | desktopdir = $(datadir)/applications 4 | desktop_DATA = $(srcdir)/*.desktop 5 | 6 | pixmapdir = $(datadir)/pixmaps 7 | pixmap_DATA = $(srcdir)/*.png 8 | 9 | endif 10 | 11 | EXTRA_DIST = $(srcdir)/*.desktop $(srcdir)/*.png 12 | -------------------------------------------------------------------------------- /src/data/Makefile.am: -------------------------------------------------------------------------------- 1 | # Il faut mettre les fichiers dans le sous dossier data de share... 2 | pkgdatadir=$(mypkgdatadir)/data 3 | 4 | dist_pkgdata_DATA = $(srcdir)/*.png 5 | 6 | bindir=${pkgdatadir} 7 | dist_bin_SCRIPTS = listUsb listDvdDrive 8 | 9 | all: 10 | chmod 0755 listUsb listDvdDrive 11 | -------------------------------------------------------------------------------- /src/locale/fr/LC_MESSAGES/Makefile.am: -------------------------------------------------------------------------------- 1 | # Il faut mettre les fichiers dans le sous dossier locale/fr/LC_MESSAGES de share... 2 | pkgdatadir=$(mypkgdatadir)/locale/fr/LC_MESSAGES 3 | 4 | %.mo: %.po 5 | msgfmt -o $@ $< 6 | 7 | dist_pkgdata_DATA = \ 8 | $(srcdir)/woeusb.mo\ 9 | $(srcdir)/wxstd.mo 10 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | woeusb (@@WOEUSB_VERSION@@) unstable; urgency=low 2 | 3 | * This is a fake changelog for packaging purpose, for the actual changelog pl- 4 | ease refer Commits · slacka/WoeUSB 5 | 6 | 7 | -- 林博仁 (Buo-Ren, Lin) Wed, 15 Nov 2017 09:04:00 +0100 8 | -------------------------------------------------------------------------------- /src/AppConfig.hpp: -------------------------------------------------------------------------------- 1 | #ifndef APP_CONFIG_MEM_WRITE 2 | #define APP_CONFIG_MEM_WRITE 3 | 4 | #include "config.hpp" 5 | 6 | #define PROG_FULL_NAME "WoeUSB" 7 | #define PROG_FULL_NAME_GETTEXT _("WoeUSB") 8 | 9 | #define PROG_PKG_NAME PACKAGE 10 | #define PROG_PKG_NAME_GETTEXT _T(PROG_PKG_NAME) 11 | 12 | #endif //APP_CONFIG_MEM_WRITE 13 | -------------------------------------------------------------------------------- /src/linux-menu/woeusbgui.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Exec=woeusbgui 4 | Icon=woeusbgui-icon 5 | Terminal=false 6 | X-MultipleArgs=false 7 | Type=Application 8 | Categories=System; 9 | Keywords=Windows;UEFI;EFI;booting; 10 | StartupNotify=true 11 | Name=WoeUSB 12 | Name[fr_FR]=WoeUSB 13 | Name[zh_TW]=WoeUSB Windows 可開機 USB 製作工具 14 | Comment=Create Windows USB stick installer from a real Windows DVD or an image. 15 | Comment[fr_FR]=Créer des clés USB d'installation de Windows depuis une image CD ou un dvd original. 16 | Comment[zh_TW]=從一個既有的 Windows DVD 或光碟映像檔建立 Windows 可開機 USB 安裝碟 17 | -------------------------------------------------------------------------------- /README.upstream: -------------------------------------------------------------------------------- 1 | winusb - A program to create Windows USB stick installer from a real Windows DVD or an image. 2 | 3 | This package contains two programs: 4 | - WinUSB-gui: a simple tool that enable you to create 5 | your own usb stick windows installer from iso image 6 | or a real DVD. 7 | - winusb: the command line tool. 8 | Supported images: Windows Vista, Seven, 8 installer for any 9 | language and any version (home, pro...) and Windows PE. 10 | 11 | Copyright (C) 2008 Colin GILLE / congelli501 12 | 13 | This file is part of winusb. 14 | winusb is sold under GPL licence (read COPYING file). 15 | 16 | Comments are welcome. 17 | 18 | - Colin GILLE / congelli501 19 | -------------------------------------------------------------------------------- /src/win32/winProg.manifest: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | c501wakeonlan 11 | 12 | 13 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Git Tracking Ignore Rules 2 | ## Debian package build generated files 3 | /debian/woeusb* 4 | /debian/files 5 | /src/stamp-h1 6 | /debian/.debhelper/ 7 | /debian/autoreconf.* 8 | /debian/debhelper-build-stamp 9 | 10 | ## Files generated by Autoconf 11 | *Makefile 12 | Makefile.in 13 | /config.* 14 | /libtool 15 | /src/config.hpp 16 | /build-stamp 17 | /autom4te.cache/ 18 | /configure 19 | /config.* 20 | /aclocal.m4 21 | /depcomp 22 | /missing 23 | /install-sh 24 | /ltmain.sh 25 | /compile 26 | /m4/ 27 | /src/config.hpp.in 28 | 29 | ## Files generated by WxWidgets build 30 | /src/.deps/ 31 | 32 | ## Compiled object code 33 | *.o 34 | 35 | ## Linked executable 36 | /src/woeusbgui 37 | 38 | ## Gettext compiled message catalogs 39 | *.mo 40 | -------------------------------------------------------------------------------- /src/woeusbgui.1: -------------------------------------------------------------------------------- 1 | .TH woeusbgui 1 "@@WOEUSB_VERSION@@" "WoeUSB" "WoeUSB User Manual" 2 | .SH NAME 3 | woeusbgui \- A GUI wrapper for woeusb(1) 4 | 5 | .SH SYNOPSIS 6 | .B woeusbgui 7 | 8 | .SH DESCRIPTION 9 | This is a GUI wrapper for woeusb(1), currently it only support 10 | .B --device 11 | creation method. 12 | .PP 13 | It is advised to use woeusb(1) instead, as it is more well-maintained and support more creation methods. 14 | 15 | .SH OPTIONS 16 | There are no command line options yet. 17 | 18 | .SH BUGS 19 | Refer our 20 | .UR https://github.com/slacka/WoeUSB/issues 21 | issue tracker 22 | .UE 23 | for any known issues 24 | .br 25 | 26 | .SH SEE ALSO 27 | woeusb(1) 28 | 29 | .SH AUTHORS 30 | Colin GILLE / congelli501 31 | .br 32 | 林博仁 33 | -------------------------------------------------------------------------------- /src/installDll.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$1" ] || [ -z "$2" ]; then 4 | echo "Usage : installDll.sh prefix host" >&2 5 | exit 1 6 | fi 7 | 8 | # Config 9 | # Le script quitte en cas d'erreur d'une commande 10 | set -o errexit 11 | 12 | # Le script quitte en cas de variables non déclarée 13 | set -o nounset 14 | 15 | prefix=$1 16 | host=$2 17 | 18 | libPath="" 19 | 20 | # build target 21 | dirList=("$host" 'i586-mingw32msvc') 22 | for value in ${dirList[*]}; do # Ubuntu 23 | if [ -d "/usr/$value/lib" ]; then 24 | libPath="/usr/$value/lib" 25 | break 26 | fi 27 | done 28 | 29 | if [ -n "$libPath" ]; then 30 | ## Mingw dll 31 | if [ -f "/usr/share/doc/mingw32-runtime/mingwm10.dll.gz" ]; then 32 | gunzip -dc "/usr/share/doc/mingw32-runtime/mingwm10.dll.gz" > "$prefix/mingwm10.dll"; 33 | fi 34 | 35 | cp "$libPath/libgcc_s_dw2-1.dll" "$prefix" 36 | else 37 | echo "Error: libPath not found!" >&2 38 | exit 1 39 | fi 40 | 41 | exit 0 42 | -------------------------------------------------------------------------------- /src/rc.rc: -------------------------------------------------------------------------------- 1 | ///File : rc.rc 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of c501WakeOnLan. 5 | 6 | c501WakeOnLan is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | c501WakeOnLan is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with c501WakeOnLan. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "wx/msw/wx.rc" 21 | 22 | 1 24 "win32/winProg.manifest" 23 | 24 | win32icon ICON "win32/icon.ico" 25 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(woeusb, @@WOEUSB_VERSION@@) 2 | AC_CONFIG_SRCDIR([src]) 3 | AM_INIT_AUTOMAKE([foreign]) 4 | AC_CONFIG_MACRO_DIR([m4]) 5 | 6 | MY_PACKAGE_INIT([WoeUSB]) 7 | 8 | dnl Checks for programs (must be here). 9 | AC_LANG([C++]) 10 | AC_PROG_INSTALL 11 | AC_PROG_CXX 12 | AC_PROG_CPP 13 | AC_PROG_LN_S 14 | 15 | dnl To compile libs 16 | LT_INIT 17 | AM_PROG_LIBTOOL dnl indique que l'on utilise Libtool pour la compilation 18 | AC_PROG_MAKE_SET dnl indique que l'on doit disposer de make qui est utilisé par Libtool 19 | 20 | MY_DETECT_OS dnl Detect OS 21 | MY_INIT_DATA_PATH dnl Define data path for unix / win32 depending on the current target system 22 | AM_FIND_WINDRES dnl Find windres is needed 23 | 24 | MY_INIT_DEBUG_SWITCH([false]) dnl Allow the user tu build the program in debug mode ; doesn't edit any cpp options ; true to force debug 25 | 26 | dnl Libs 27 | MY_FIND_STDCPP 28 | MY_FIND_WXWIDGETS 29 | 30 | AC_OUTPUT([Makefile 31 | 32 | src/Makefile 33 | src/data/Makefile 34 | src/linux-menu/Makefile 35 | src/win32/Makefile 36 | src/locale/Makefile 37 | src/locale/fr/Makefile 38 | src/locale/zh_TW/Makefile 39 | src/locale/fr/LC_MESSAGES/Makefile 40 | src/locale/zh_TW/LC_MESSAGES/Makefile 41 | debian/Makefile 42 | innoSetup/Makefile]) 43 | 44 | MY_ECHO_BUILD_INFO # Recap 45 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | data\ 3 | locale\ 4 | win32\ 5 | linux-menu 6 | 7 | bin_PROGRAMS=woeusbgui 8 | 9 | INCLUDES = $(CFLAGS_ALL) 10 | 11 | woeusbgui_LDFLAGS = $(EXTRA_LDFLAGS) 12 | 13 | woeusbgui_LDADD = $(LIBS_ALL) 14 | 15 | woeusbguiSrcBase = \ 16 | AppConfig.hpp\ 17 | DialogAbout.hpp\ 18 | MainPanel.cpp\ 19 | App.cpp\ 20 | findFile.cpp\ 21 | MainPanel.hpp\ 22 | processManager.hpp\ 23 | App.hpp\ 24 | findFile.hpp\ 25 | MyException.cpp\ 26 | strWxStdConv.cpp\ 27 | MainFrame.cpp\ 28 | MyException.hpp\ 29 | strWxStdConv.hpp\ 30 | DialogAbout.cpp\ 31 | MainFrame.hpp\ 32 | nbStrConvert.hpp\ 33 | processManager.cpp 34 | 35 | 36 | ## --------------- Resources windows --------------- 37 | .rc.o: 38 | i586-mingw32msvc-windres $^ -o $@ $(EXTRA_WINDRES_ARG) 39 | 40 | if HAVE_WINDRES 41 | woeusbgui_SOURCES=$(woeusbguiSrcBase) rc.rc 42 | else 43 | woeusbgui_SOURCES=$(woeusbguiSrcBase) 44 | endif 45 | ## --------------- Resources windows --------------- 46 | 47 | # Install my_script in $(bindir) and distribute it. 48 | dist_bin_SCRIPTS = woeusb 49 | 50 | man_MANS = \ 51 | woeusbgui.1\ 52 | woeusb.1 53 | 54 | if IS_MINGW 55 | install-data-hook: 56 | ## Install Dlls 57 | "$(srcdir)/installDll.sh" "$(prefix)" "$(host)" 58 | endif 59 | 60 | EXTRA_DIST = \ 61 | $(srcdir)/*.cbp\ 62 | $(man_MANS)\ 63 | $(srcdir)/rc.rc\ 64 | $(srcdir)/installDll.sh 65 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: woeusb 2 | Homepage: https://github.com/slacka/WoeUSB 3 | Section: utils 4 | Priority: optional 5 | Maintainer: 林博仁 (Buo-Ren, Lin) 6 | Build-Depends: debhelper (>= 9), 7 | dh-autoreconf, 8 | git-core, 9 | libwxgtk2.8-dev | libwxgtk3.0-dev | libwxgtk3.0-gtk3-dev, 10 | realpath | coreutils (>= 8.23) 11 | Standards-Version: 4.1.1 12 | Vcs-Browser: https://github.com/slacka/WoeUSB/ 13 | Vcs-Git: https://github.com/slacka/WoeUSB.git 14 | 15 | Package: woeusb 16 | Architecture: any 17 | Depends: bash (>=4.3), 18 | dosfstools, 19 | gettext, 20 | grub2-common, 21 | grub-pc-bin, 22 | ntfsprogs | ntfs-3g, 23 | p7zip-full, 24 | parted, 25 | policykit-1, 26 | realpath | coreutils (>= 8.23), 27 | wget, 28 | ${misc:Depends}, 29 | ${shlibs:Depends} 30 | Description: Bootable Windows installation/PE USB storage creator 31 | This package contains two programs: 32 | . 33 | - woeusb: An command-line utility that enables you to create your own bootable 34 | Windows installation USB storage device from an existing Windows Installation 35 | DVD or its ISO image. 36 | - woeusbgui: A woeusb's GUI wrapper program based on WxWidgets GUI library. 37 | . 38 | Supported images: Windows Vista~10+ installation media for any language and 39 | edition(Home/Professional...) and Windows PE-based media. 40 | . 41 | WoeUSB is a fork of Colin GILLE / congelli501's WinUSB software. 42 | http://en.congelli.eu/prog_info_winusb.html 43 | -------------------------------------------------------------------------------- /src/processManager.hpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of WoeUSB. 4 | 5 | WoeUSB is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | WoeUSB is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with WoeUSB. If not, see . 17 | */ 18 | //------------------------------------------------------------------------------ 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | //------------------------------------------------------------------------------ 25 | class PipeManager 26 | { 27 | public: 28 | PipeManager(const std::string &command); 29 | ~PipeManager(); 30 | 31 | std::string GetLine(); 32 | bool GetLine(std::string &line); 33 | bool IsEof() const; 34 | int Close(); 35 | 36 | private: 37 | FILE *m_pipe; 38 | }; 39 | //------------------------------------------------------------------------------ 40 | int GetProcessOutput(const std::string &command, std::string &str); 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /src/findFile.hpp: -------------------------------------------------------------------------------- 1 | ///File : findFile.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "wx/wxprec.h" 21 | 22 | #ifdef __BORLANDC__ 23 | #pragma hdrstop 24 | #endif 25 | 26 | #ifndef WX_PRECOMP 27 | #include "wx/wx.h" 28 | #endif 29 | //------------------------------------------------------------------------------ 30 | #include 31 | //------------------------------------------------------------------------------ 32 | #include "config.hpp" 33 | //------------------------------------------------------------------------------ 34 | 35 | #if not defined PACKAGE 36 | #error PACKAGE should be defined. 37 | #endif 38 | 39 | #if not defined FIND_FILE_HPP_WINUSBGUI 40 | #define FIND_FILE_HPP_WINUSBGUI 41 | 42 | wxString findFile(const wxString &str); 43 | 44 | #endif //FIND_FILE_HPP_WINUSBGUI 45 | -------------------------------------------------------------------------------- /src/data/listDvdDrive: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # An utility script to provide GUI available source optical disk drives 3 | # FIXME: Should be named listOpticalDiskdrive instead of listDvdDrive 4 | # Copyright © 2013 Colin GILLE / congelli501 5 | # Copyright © 2017 slacka et. al. 6 | 7 | # This file is part of WoeUSB. 8 | # 9 | # WoeUSB is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # WoeUSB is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with WoeUSB If not, see . 21 | 22 | ## Makes debuggers' life easier - Unofficial Bash Strict Mode 23 | ## BASHDOC: Shell Builtin Commands - Modifying Shell Behavior - The Set Builtin 24 | set -o errexit 25 | set -o errtrace 26 | set -o nounset 27 | set -o pipefail 28 | 29 | declare optical_disk_drive_devfs_path 30 | 31 | while read sysfs_block_device_path; do 32 | if echo "${sysfs_block_device_path}"\ 33 | | grep '/block/sr' > /dev/null; then 34 | optical_disk_drive_devfs_path="/dev/$(basename "${sysfs_block_device_path}")" 35 | echo "${optical_disk_drive_devfs_path}" 36 | echo "${optical_disk_drive_devfs_path} - $(cat "${sysfs_block_device_path}/device/model")" 37 | fi 38 | done < <(\ 39 | find\ 40 | /sys/block\ 41 | -maxdepth 1\ 42 | -mindepth 1\ 43 | ) 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Travis CI Configuration 2 | # https://docs.travis-ci.com 3 | ## Lesser history 4 | git: 5 | depth: 30 6 | 7 | ## Use container-based infrastructure for quicker build start-up 8 | sudo: false 9 | 10 | ## We only support Ubuntu 14.04 and newer 11 | dist: trusty 12 | 13 | addons: 14 | apt: 15 | packages: 16 | - realpath # Not required least after 16.04 17 | - autotools-dev 18 | - libwxgtk2.8-dev 19 | - devscripts # For mk-build-deps 20 | - equivs # mk-build-deps requires this to be installed 21 | 22 | language: cpp 23 | 24 | compiler: 25 | - gcc 26 | 27 | script: 28 | # For triggering smudge-version 29 | - ./setup-development-environment.bash 30 | - mk-build-deps && mv woeusb-build-deps*.deb .. 31 | - autoreconf --force --install 32 | - ./configure 33 | - make 34 | 35 | deploy: 36 | provider: releases 37 | api_key: 38 | secure: RJHRp/Ou83QtkZXdS/UXiOIf1hfsUzg1ZPVZNi18oNTQcMwcHut9IqsaJEb5ZmwdC9/0TIqkoXaPTXUatVS5G+OaPXhFh0FPWFlzpIKIa4xiM7juhoettvK50r7B0+QyfIcMuZ+wTP6h3itXkeGm97xTqOnMmGn2BpefmAQ8nMKcw6ehD9F1LFPIiGJSw16Sli5b4s9hkyJtslyxjriWsLypuIFA+z7/PAPFj4UmbAqNCTQH3yHUHkNPHomf0S405uecgGlV4eYqc10nNP0Y/2gN1pDwSx7HNbCSR/ufhLXc2dH+JBho7lJRCCaJKZ2PX2JeCndWOLAmKkuz2snV/aMcDzaXb6G5MQ3UPKsbaMJHaiKzz48LBDVeOsbhL7FF4cs+JdiPQGaTzTTSg35j6MXM28WirJ7VxEpVRxjrILgbRXasJIRXaB0Ttimgu2L2fJr2GDT3EBfVj5mT+GpXgsqwXlGP/QBKrB1170g4ATPHKmzmXqCYo7DZw6qZ5T1G0ZiZm9TX82OlYuNNo7fkuquo6Q7z6kJRlwmI0PPnR54IUuI6wrcOvWc/PoEBhRQvGpzyBadiLeFoQrAgHofcnGPfIbqmY/2cZiZza/XvnxVwa1NEHCGXZEcRYHeAQyRGtikxUNuhlP93sDLvPg61QuQVV/y+yXVVtuFDrLuL+L4= 39 | file_glob: true 40 | file: 41 | - ../woeusb-build-deps*.deb 42 | - ".github/The source code archives provided here is NOT supported, please use git-clone instead" 43 | on: 44 | repo: slacka/WoeUSB 45 | tags: true 46 | -------------------------------------------------------------------------------- /src/MyException.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of WoeUSB. 4 | 5 | WoeUSB is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | WoeUSB is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with WoeUSB. If not, see . 17 | */ 18 | //------------------------------------------------------------------------------ 19 | #include "MyException.hpp" 20 | #include 21 | //------------------------------------------------------------------------------ 22 | namespace En 23 | { 24 | //------------------------------------------------------------------------------ 25 | MyException::MyException(const std::string& info) throw() : m_info(info) 26 | { 27 | //std::cerr << info << std::endl; 28 | } 29 | //------------------------------------------------------------------------------ 30 | MyException::~MyException() throw() 31 | { 32 | 33 | } 34 | //------------------------------------------------------------------------------ 35 | const char* MyException::what() const throw() 36 | { 37 | return m_info.c_str(); 38 | } 39 | //------------------------------------------------------------------------------ 40 | } // namespace En 41 | //------------------------------------------------------------------------------ 42 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: WoeUSB 3 | Upstream-Contact: WoeUSB Issue Tracker 4 | Source: https://github.com/slacka/WoeUSB 5 | License: GPL-3.0+ 6 | 7 | Files: * 8 | Copyright: 2008–2013 Colin GILLE (Congelli501) 9 | 2015–2017 Luke Benes (slacka) 10 | 2016–2018 林博仁 (Buo-Ren Lin) 11 | Comment: 12 | WoeUSB is a fork of WinUSB which Colin GILLE created and maintained up to 13 | v1.0.11 (2013-03-27). See http://en.congelli.eu/prog_info_winusb.html and 14 | http://ppa.launchpad.net/colingille/freshlight/ubuntu/pool/main/w/winusb/ 15 | License: GPL-3.0+ 16 | 17 | Files: debian/* 18 | Copyright: 2012–2013 Colin GILLE (Congelli501) 19 | 2016–2018 林博仁 (Buo-Ren Lin) 20 | License: GPL-3.0+ 21 | 22 | License: GPL-3.0+ 23 | This program is free software: you can redistribute it and/or modify 24 | it under the terms of the GNU General Public License as published by 25 | the Free Software Foundation, either version 3 of the License, or 26 | (at your option) any later version. 27 | . 28 | This package is distributed in the hope that it will be useful, 29 | but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | GNU General Public License for more details. 32 | . 33 | You should have received a copy of the GNU General Public License 34 | along with this program. If not, see . 35 | . 36 | On Debian systems, the complete text of the GNU General 37 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 38 | -------------------------------------------------------------------------------- /src/woeusbgui.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 49 | 50 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ## Good Habit Checklist for Issue Reporting 2 | Checkout [Mastering Markdown · GitHub Guides](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) if you need help on the GitHub-flavored Markdown syntax. You may remove sections and contents that don't apply. 3 | 4 | * [ ] I've searched the issue tracker and is pretty sure that there's no duplicate issue already filed 5 | * [ ] I've built the latest development snapshot using the instructions in README and verified that the issue can still be reproduced (for bug reports) 6 | 7 | ## Issue Reproduce Instructions 8 | > 1. Launch WoeUSB by running `` 9 | > 2. Do blablabla... 10 | 11 | ## Expected Behavior 12 | > No error 13 | 14 | ## Current Behavior 15 | > WoeUSB errors with message "blablabla" 16 | 17 | ## Info of My Environment 18 | ### WoeUSB Version 19 | > For source code build, run `git describe --tags --always --dirty` under the source tree, for prebuilt releases refer the source that provides WoeUSB 20 | 21 | ### WoeUSB Source 22 | > Built from source code, commit abcdefg 23 | > Installed from Ubuntu 16.04 software archive 24 | > Installed from WebUpd8 PPA 25 | 26 | ### GNU Bash Version 27 | > WoeUSB exploits several advanced features of the Bash scripting language and requires a relatively-recent Bash intepreter. Run `bash --version` in a terminal to acquire this information. 28 | 29 | ### Information about the Operating System 30 | > Different OS distributions provides different characteristics and may influence the result of running WoeUSB. Run `lsb_release --description` or `lsb_release -d` in a terminal to acquire this information. 31 | 32 | ### Information about the Source Media 33 | > "Windows 9 Professional Edition" downloaded from 34 | 35 | ### Information about the Target Device 36 | > Transcend JetFlash® 790K 64GB (USB 3.1 variant) 37 | -------------------------------------------------------------------------------- /src/App.hpp: -------------------------------------------------------------------------------- 1 | ///File : App.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "wx/wxprec.h" 21 | 22 | #ifdef __BORLANDC__ 23 | #pragma hdrstop 24 | #endif 25 | 26 | #ifndef WX_PRECOMP 27 | #include "wx/wx.h" 28 | #endif 29 | //------------------------------------------------------------------------------ 30 | #include 31 | #include 32 | #include 33 | #include 34 | //------------------------------------------------------------------------------ 35 | #include "config.hpp" 36 | #include "findFile.hpp" 37 | #include "MainFrame.hpp" 38 | #include "AppConfig.hpp" 39 | //------------------------------------------------------------------------------ 40 | 41 | #if not defined APP_HPP_WINUSBGUI 42 | #define APP_HPP_WINUSBGUI 43 | 44 | class App : public wxApp 45 | { 46 | public: 47 | virtual bool OnInit(); 48 | virtual int OnRun(); 49 | 50 | private: 51 | wxLocale m_locale; 52 | MainFrame *m_frame; 53 | }; 54 | //------------------------------------------------------------------------------ 55 | 56 | #endif //APP_HPP_WINUSBGUI 57 | -------------------------------------------------------------------------------- /src/strWxStdConv.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of WoeUSB. 4 | 5 | WoeUSB is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | WoeUSB is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with WoeUSB. If not, see . 17 | */ 18 | //------------------------------------------------------------------------------ 19 | #include "strWxStdConv.hpp" 20 | //------------------------------------------------------------------------------ 21 | wxString wxStrAutoCut(wxString str, const unsigned int &maxLen) 22 | { 23 | if(str.Len() > maxLen) 24 | { 25 | str = str.Mid(0, maxLen - 3); 26 | str << _T("..."); 27 | } 28 | 29 | return str; 30 | } 31 | //------------------------------------------------------------------------------ 32 | std::string StrWxToStd(const wxString &str) 33 | { 34 | return std::string(str.mb_str(wxConvUTF8)); 35 | } 36 | //------------------------------------------------------------------------------ 37 | wxString StrStdToWx(const std::string &str) 38 | { 39 | return wxString(str.c_str(), wxConvUTF8); 40 | } 41 | //------------------------------------------------------------------------------ 42 | // Filename 43 | std::string filenameWxToStd(const wxString &str) 44 | { 45 | return std::string(str.mb_str(wxConvFile)); 46 | } 47 | //------------------------------------------------------------------------------ 48 | wxString filenameStdToWx(const std::string &str) 49 | { 50 | return wxString(str.c_str(), wxConvFile); 51 | } 52 | //------------------------------------------------------------------------------ 53 | -------------------------------------------------------------------------------- /innoSetup/setup.iss: -------------------------------------------------------------------------------- 1 | ; File : setup.iss 2 | ;------------------------------------------------------------------------------ 3 | ; This file is part of woeusb. 4 | ; 5 | ; woeusb is free software: you can redistribute it and/or modify 6 | ; it under the terms of the GNU General Public License as published by 7 | ; the Free Software Foundation, either version 3 of the License, or 8 | ; (at your option) any later version. 9 | ; 10 | ; woeusb is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ; GNU General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU General Public License 16 | ; along with woeusb. If not, see . 17 | ;------------------------------------------------------------------------------ 18 | 19 | 20 | ; Script generated by the Inno Setup Script Wizard. 21 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 22 | 23 | [Setup] 24 | ; NOTE: The value of AppId uniquely identifies this application. 25 | ; Do not use the same AppId value in installers for other applications. 26 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 27 | AppId={{7B35966E-246C-4D0B-98E8-53F1F1C9D8F5} 28 | AppName=WoeUSB 29 | AppVerName=WoeUSB 1.0.11 30 | AppPublisher=Congelli 501 / Colin GILLE 31 | AppPublisherURL=http://fr.congelli.eu/ 32 | AppSupportURL=http://fr.congelli.eu/ 33 | AppUpdatesURL=http://fr.congelli.eu/ 34 | DefaultDirName={pf}\WoeUSB 35 | DefaultGroupName=WoeUSB 36 | LicenseFile=../COPYING 37 | InfoBeforeFile=../ChangeLog 38 | OutputDir=. 39 | OutputBaseFilename=setup 40 | Compression=lzma 41 | SolidCompression=yes 42 | 43 | [Languages] 44 | Name: french; MessagesFile: compiler:Languages\French.isl 45 | 46 | [Files] 47 | Source: winPack/*; DestDir: {app}; Flags: ignoreversion recursesubdirs 48 | 49 | [Icons] 50 | ; Tt 51 | Name: {group}\{cm:ProgramOnTheWeb,Congelli 501}; Filename: http://www.congelli.eu/ 52 | Name: {group}\WoeUSB; Filename: {app}\WoeUSB.exe 53 | Name: {group}\{cm:UninstallProgram,WoeUSB}; Filename: {uninstallexe} 54 | -------------------------------------------------------------------------------- /src/nbStrConvert.hpp: -------------------------------------------------------------------------------- 1 | ///File : nbConvert.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | Copyright (C) 2009 Colin GILLE / congelli501 5 | 6 | This file is part of Devis Maker. 7 | Devis Maker is sold under Devis Maker license (read COPYING file). 8 | */ 9 | //------------------------------------------------------------------------------ 10 | #include 11 | #include 12 | #include 13 | //------------------------------------------------------------------------------ 14 | #if not defined NB_STR_CONVERT_HPP 15 | #define NB_STR_CONVERT_HPP 16 | //------------------------------------------------------------------------------ 17 | template < typename T > 18 | std::string nbToString(const T &nb) 19 | { 20 | std::stringstream ss; 21 | std::string str; 22 | if(sizeof(T) != 1) // Pas char 23 | { 24 | ss << std::fixed << nb; // fixed : pas de nb scientifique. Par contre, plein de zero... 25 | } 26 | else 27 | { 28 | // Type char ==> on le tranforme en int 29 | ss << std::fixed << int(nb); // fixed : pas de nb scientifique. Par contre, plein de zero... 30 | } 31 | ss >> str; 32 | 33 | // On enléve les 0 et . innutils 34 | std::string::iterator it = str.end() - 1; 35 | if(str.find('.') != std::string::npos) // On ne racourci pas le nb si pas de virgule 36 | { 37 | while(str.size() > 1 && *it == '0') 38 | { 39 | str.erase(it); 40 | it = str.end() - 1; 41 | } 42 | 43 | if(*it == '.') // Si on arrive à la virgule ==> suppression. 44 | { 45 | str.erase(it); 46 | } 47 | } 48 | 49 | return str; 50 | } 51 | 52 | //------------------------------------------------------------------------------ 53 | template < typename T > 54 | T stringToNb(std::string nbStr) 55 | { 56 | std::stringstream ss; 57 | T nb; 58 | ss << nbStr; 59 | if(sizeof(T) != 1) // Pas char 60 | { 61 | ss >> nb; 62 | } 63 | else 64 | { 65 | // Type char ==> on le tranforme en int 66 | int tmp; 67 | ss >> tmp; 68 | nb = char(tmp); 69 | } 70 | 71 | return nb; 72 | } 73 | //------------------------------------------------------------------------------ 74 | #endif // NB_STR_CONVERT_HPP 75 | -------------------------------------------------------------------------------- /src/MainFrame.hpp: -------------------------------------------------------------------------------- 1 | ///File : MainFrame.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | #if not defined MAIN_FRAME_HPP_WINUSBGUI 20 | #define MAIN_FRAME_HPP_WINUSBGUI 21 | 22 | //------------------------------------------------------------------------------ 23 | #include "wx/wxprec.h" 24 | 25 | #ifdef __BORLANDC__ 26 | #pragma hdrstop 27 | #endif 28 | 29 | #ifndef WX_PRECOMP 30 | #include "wx/wx.h" 31 | #endif 32 | //------------------------------------------------------------------------------ 33 | #include 34 | #include 35 | #include 36 | //------------------------------------------------------------------------------ 37 | #include "findFile.hpp" 38 | #include "MainPanel.hpp" 39 | #include "DialogAbout.hpp" 40 | #include "AppConfig.hpp" 41 | //------------------------------------------------------------------------------ 42 | 43 | class MainFrame : public wxFrame 44 | { 45 | public: 46 | MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style = wxDEFAULT_FRAME_STYLE); 47 | void OnQuit(wxCommandEvent& event); 48 | void OnAbout(wxCommandEvent& event); 49 | 50 | wxToolBarToolBase *ToolBarAddButton(const wxString &label, const wxString &dataFilename); 51 | wxMenuItem *MenuAddItem( wxMenu *parentMenu, const wxString &label, const wxString &dataFilename); 52 | 53 | void EnableButtons(const bool &adrSelected); 54 | 55 | bool IsShowAllChecked() const; 56 | 57 | protected: 58 | MainPanel *m_MainPanel; 59 | wxMenuBar *m_MenuBar; 60 | 61 | wxMenuItem *m_menuItemShowAll; 62 | }; 63 | 64 | #endif //MAIN_FRAME_HPP_WINUSBGUI 65 | -------------------------------------------------------------------------------- /src/findFile.cpp: -------------------------------------------------------------------------------- 1 | ///File : findFile.cpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "findFile.hpp" 21 | #include 22 | //------------------------------------------------------------------------------ 23 | 24 | wxString findFile(const wxString &str) 25 | { 26 | wxString testPath; 27 | 28 | testPath = wxGetCwd() + _T("/") + str; 29 | if(wxFileExists(testPath) || wxDirExists(testPath)) // Si c'est dans le dossier ./ 30 | { 31 | return testPath; 32 | } 33 | 34 | testPath = _T("../") + str; 35 | if(wxFileExists(testPath) || wxDirExists(testPath)) // Si c'est dans le dossier ../ 36 | { 37 | return testPath; 38 | } 39 | 40 | #if (defined(__UNIX__) && wxCHECK_VERSION(3, 0, 0)) 41 | testPath = wxString(wxStandardPaths::Get().GetInstallPrefix() + _T("/share/") + _T(PACKAGE) + _T("/") + str); 42 | if(wxFileExists(testPath) || wxDirExists(testPath)) // Si c'est dans le dossier /usr/.../share/nomprog 43 | { 44 | return testPath; 45 | } 46 | //FIXME: remove when 2.8 depreciated 47 | #elif (defined(__UNIX__) && wxCHECK_VERSION(2, 8, 0)) 48 | testPath = wxString(wxStandardPaths().GetInstallPrefix() + _T("/share/") + _T(PACKAGE) + _T("/") + str); 49 | { 50 | return testPath; 51 | } 52 | #endif // defined(__UNIX__) 53 | 54 | #if wxCHECK_VERSION(3, 0, 0) 55 | testPath = wxString(wxStandardPaths::Get().GetDataDir() + _T("/") + str); 56 | //FIXME: remove when 2.8 depreciated 57 | #else 58 | testPath = wxString(wxStandardPaths().GetDataDir() + _T("/") + str); 59 | #endif //wx2 legacy 60 | if(wxFileExists(testPath) || wxDirExists(testPath)) // Si c'est dans le dossier /usr/.../share/nomPaquet 61 | { 62 | return testPath; 63 | } 64 | 65 | // Si non 66 | wxMessageBox(_("File not Found : ") + str, _("Error"), wxICON_ERROR); 67 | return _T(""); 68 | } 69 | -------------------------------------------------------------------------------- /debian/rules.old: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | # These are used for cross-compiling and for saving the configure script 14 | # from having to guess our platform (since we know it already) 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 17 | ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) 18 | CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) 19 | else 20 | CROSS= --build $(DEB_BUILD_GNU_TYPE) 21 | endif 22 | 23 | 24 | 25 | config.status: configure 26 | dh_testdir 27 | # Add here commands to configure the package. 28 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" 29 | cp -f /usr/share/misc/config.sub config.sub 30 | endif 31 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" 32 | cp -f /usr/share/misc/config.guess config.guess 33 | endif 34 | ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" 35 | 36 | 37 | build: build-stamp 38 | 39 | build-stamp: config.status 40 | dh_testdir 41 | 42 | # Add here commands to compile the package. 43 | $(MAKE) 44 | 45 | touch $@ 46 | 47 | clean: 48 | dh_testdir 49 | dh_testroot 50 | rm -f build-stamp 51 | 52 | # Add here commands to clean up after the build process. 53 | [ ! -f Makefile ] || $(MAKE) distclean 54 | rm -f config.sub config.guess 55 | 56 | dh_clean 57 | 58 | install: build 59 | dh_testdir 60 | dh_testroot 61 | dh_prep 62 | dh_installdirs 63 | 64 | # Add here commands to install the package into debian/woeusb. 65 | $(MAKE) DESTDIR="$(CURDIR)/debian/woeusb" install 66 | 67 | 68 | # Build architecture-independent files here. 69 | binary-indep: install 70 | # We have nothing to do by default. 71 | 72 | # Build architecture-dependent files here. 73 | binary-arch: install 74 | dh_testdir 75 | dh_testroot 76 | dh_installchangelogs ChangeLog 77 | dh_installdocs 78 | dh_installexamples 79 | # dh_install 80 | # dh_installmenu 81 | # dh_installdebconf 82 | # dh_installlogrotate 83 | # dh_installemacsen 84 | # dh_installpam 85 | # dh_installmime 86 | # dh_python 87 | # dh_installinit 88 | # dh_installcron 89 | # dh_installinfo 90 | dh_installman 91 | dh_link 92 | dh_strip 93 | dh_compress 94 | dh_fixperms 95 | # dh_perl 96 | # dh_makeshlibs 97 | dh_installdeb 98 | dh_shlibdeps 99 | dh_gencontrol 100 | dh_md5sums 101 | dh_builddeb 102 | 103 | binary: binary-indep binary-arch 104 | .PHONY: build clean binary-indep binary-arch binary install 105 | -------------------------------------------------------------------------------- /src/MainPanel.hpp: -------------------------------------------------------------------------------- 1 | ///File : MainPanel.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "wx/wxprec.h" 21 | 22 | #ifdef __BORLANDC__ 23 | #pragma hdrstop 24 | #endif 25 | 26 | #ifndef WX_PRECOMP 27 | #include "wx/wx.h" 28 | #endif 29 | //------------------------------------------------------------------------------ 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | //------------------------------------------------------------------------------ 38 | #include "config.hpp" 39 | #include "findFile.hpp" 40 | #include "AppConfig.hpp" 41 | #include 42 | 43 | //------------------------------------------------------------------------------ 44 | 45 | #if not defined MAIN_PANEL_HPP_WINUSBGUI 46 | #define MAIN_PANEL_HPP_WINUSBGUI 47 | //------------------------------------------------------------------------------ 48 | class MainFrame; 49 | //------------------------------------------------------------------------------ 50 | void SendNotification(const wxString &title, const wxString &text = _T(""), wxString iconFilename = _T("")); 51 | //------------------------------------------------------------------------------ 52 | class MainPanel : public wxPanel 53 | { 54 | public: 55 | MainPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL ); 56 | ~MainPanel(); 57 | 58 | void OnSourceOptionChanged(wxCommandEvent& event); 59 | void OnListOrFileModified(wxCommandEvent& event); 60 | void OnRefresh(wxCommandEvent& event); 61 | void OnInstall(wxCommandEvent& event); 62 | void OnShowAllDrive(wxCommandEvent& event); 63 | 64 | void RefreshListContent(); 65 | 66 | bool IsInstallOk() const; 67 | 68 | private: 69 | wxListBox *m_dvdDriveList, *m_usbStickList; 70 | std::vector m_dvdDriveDevList, m_usbStickDevList; 71 | wxFilePickerCtrl *m_isoFile; 72 | 73 | MainFrame *m_parentFrame; 74 | 75 | wxButton *m_btInstall, *m_btRefresh; 76 | 77 | wxRadioButton *m_isoChoice, *m_dvdChoice; 78 | 79 | wxRadioBox *m_fsRadio; 80 | 81 | //std::vector > m_list; 82 | }; 83 | 84 | #endif //MAIN_PANEL_HPP_WINUSBGUI 85 | -------------------------------------------------------------------------------- /src/DialogAbout.hpp: -------------------------------------------------------------------------------- 1 | ///File : DialogAbout.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #ifndef DIALOG_ABOUT_HPP_WINUSBGUI 21 | #define DIALOG_ABOUT_HPP_WINUSBGUI 22 | 23 | #include "wx/wxprec.h" 24 | 25 | #ifdef __BORLANDC__ 26 | #pragma hdrstop 27 | #endif 28 | 29 | #ifndef WX_PRECOMP 30 | #include "wx/wx.h" 31 | #endif 32 | //------------------------------------------------------------------------------ 33 | #include 34 | //------------------------------------------------------------------------------ 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | //------------------------------------------------------------------------------ 43 | #include "config.hpp" 44 | #include "findFile.hpp" 45 | #include "AppConfig.hpp" 46 | /////////////////////////////////////////////////////////////////////////// 47 | #if defined VERSION 48 | #define NUM_VERSION _(VERSION) 49 | #else 50 | #define NUM_VERSION _T("1.0.0") 51 | #endif 52 | 53 | /////////////////////////////////////////////////////////////////////////////// 54 | /// Class PanelNoteBookAutors 55 | /////////////////////////////////////////////////////////////////////////////// 56 | class PanelNoteBookAutors : public wxPanel 57 | { 58 | public: 59 | PanelNoteBookAutors(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString &autherName = _T(""), const wxString &imgName = _T(""), const wxString &siteLink = _T(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL); 60 | }; 61 | 62 | /////////////////////////////////////////////////////////////////////////////// 63 | /// Class about 64 | /////////////////////////////////////////////////////////////////////////////// 65 | class DialogAbout : public wxDialog 66 | { 67 | public: 68 | DialogAbout( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,590 ), long style = wxDEFAULT_DIALOG_STYLE ); 69 | 70 | protected: 71 | wxStaticBitmap* m_bitmapIcone; 72 | wxStaticText* m_staticTextTitre; 73 | wxStaticText* m_staticTextVersion; 74 | wxNotebook* m_NotebookAutorLicence; 75 | PanelNoteBookAutors *MyPanelNoteBookAutors; 76 | wxButton* m_BtOk; 77 | }; 78 | 79 | #endif //DIALOG_ABOUT_HPP_WINUSBGUI 80 | -------------------------------------------------------------------------------- /polkit/com.github.slacka.woeusb.policy: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | The WoeUSB Project 9 | https://github.com/slacka/WoeUSB 10 | woeusbgui-icon 11 | 12 | 13 | Run `woeusb` as SuperUser 14 | 以超級使用者(SuperUser)身份執行 `woeusb` 15 | 16 | Authentication is required to run `woeusb` as SuperUser. 17 | 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。 18 | 19 | 20 | auth_admin 21 | auth_admin 22 | auth_admin_keep 23 | 24 | 25 | /usr/bin/woeusb 26 | 27 | 28 | 29 | Run `woeusb` as SuperUser 30 | 以超級使用者(SuperUser)身份執行 `woeusb` 31 | 32 | Authentication is required to run `woeusb` as SuperUser. 33 | 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。 34 | 35 | 36 | auth_admin 37 | auth_admin 38 | auth_admin_keep 39 | 40 | 41 | /usr/local/bin/woeusb 42 | 43 | 44 | 45 | WoeUSB running in --format mode. 46 | WoeUSB 以 --format 模式運行 47 | 48 | Superuser privilege is required for WoeUSB to modify your target device's partition table, create target partiton, format target filesystem, mount and unmount target filesystem, install bootloader and etc. 49 | WoeUSB 需要「超級使用者(SuperUser)」權限以修改您目標裝置的分區表、建立目標分區、格式化目標檔案系統、掛載與解除掛載目標檔案系統、安裝開機載入器以及其他操作。 50 | 51 | 52 | auth_admin 53 | auth_admin 54 | auth_admin_keep 55 | 56 | 57 | 58 | 59 | WoeUSB running in --install mode. 60 | WoeUSB 以 --install 模式運行 61 | 62 | Superuser privilege is required for WoeUSB to mount and unmount target filesystem, install bootloader and etc. 63 | WoeUSB 需要「超級使用者(SuperUser)」權限以掛載與解除掛載目標檔案系統、安裝開機載入器以及其他操作。 64 | 65 | 66 | auth_admin 67 | auth_admin 68 | auth_admin_keep 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/data/listUsb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # An utility script to provide GUI available target devices 3 | # FIXME: Should be named listTargetDevices instead of listUsb 4 | # Copyright © 2013 Colin GILLE / congelli501 5 | # Copyright © 2017 slacka et. al. 6 | 7 | # This file is part of WoeUSB. 8 | # 9 | # WoeUSB is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # WoeUSB is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with WoeUSB If not, see . 21 | 22 | ## Makes debuggers' life easier - Unofficial Bash Strict Mode 23 | ## BASHDOC: Shell Builtin Commands - Modifying Shell Behavior - The Set Builtin 24 | set -o errexit 25 | set -o errtrace 26 | set -o nounset 27 | set -o pipefail 28 | 29 | # Show all devices, not just removable ones 30 | declare -i show_all_devices=0 31 | 32 | if [ "$#" -ge 1 ] \ 33 | && [ "$1" = 'all' ]; then 34 | show_all_devices=1 35 | fi 36 | 37 | is_removable_and_writable_device(){ 38 | local block_device_name="$1" 39 | 40 | local -r sysfs_block_device_dir="/sys/block/${block_device_name}" 41 | 42 | # We consider device not removable if the removable sysfs item not exist 43 | if [ -f "${sysfs_block_device_dir}/removable" ] \ 44 | && [ "$(cat "${sysfs_block_device_dir}/removable")" -eq 1 ]\ 45 | && [ "$(cat "${sysfs_block_device_dir}/ro")" -eq 0 ]; then 46 | return 0 47 | else 48 | return 1 49 | fi 50 | } 51 | 52 | declare block_device 53 | declare device_capacity 54 | declare device_model 55 | 56 | while read block_device_name; do 57 | if grep --extended-regexp "^sr.*$|^cdrom.*$" <<< "${block_device_name}" >/dev/null; then 58 | # Known non-target blacklist 59 | continue 60 | # NOTE: We might not need this check at all as loop devices also has removable sysfs entry 61 | # elif grep '^loop.*$' <<< "${block_device_name}" >/dev/null; then 62 | # if [ "${show_all_devices}" -eq 0 ]; then 63 | # continue 64 | # fi 65 | elif ! is_removable_and_writable_device "${block_device_name}"; then 66 | if [ "${show_all_devices}" -eq 0 ]; then 67 | continue 68 | fi 69 | fi 70 | 71 | # FIXME: Needs a more reliable detection mechanism instead of simply assuming it is under /dev 72 | block_device="/dev/${block_device_name}" 73 | device_capacity="$(\ 74 | lsblk\ 75 | --output SIZE\ 76 | --noheadings\ 77 | --nodeps\ 78 | "${block_device}"\ 79 | )" 80 | device_model="$(\ 81 | lsblk\ 82 | --output MODEL\ 83 | --noheadings\ 84 | --nodeps\ 85 | "${block_device}"\ 86 | | sed 's/\s//g' 87 | )" 88 | 89 | echo "${block_device}" 90 | 91 | # It's possible that the device has no model(e.g. loop device) 92 | if [ -n "${device_model}" ]; then 93 | echo "${block_device}(${device_model}, $device_capacity)" 94 | else 95 | echo "${block_device}($device_capacity)" 96 | fi 97 | done < <(lsblk --output NAME --noheadings --nodeps) 98 | 99 | exit 0 100 | -------------------------------------------------------------------------------- /src/processManager.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of WoeUSB. 4 | 5 | WoeUSB is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | WoeUSB is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with WoeUSB. If not, see . 17 | */ 18 | //------------------------------------------------------------------------------ 19 | #include "processManager.hpp" 20 | 21 | 22 | #include "MyException.hpp" 23 | 24 | //------------------------------------------------------------------------------ 25 | PipeManager::PipeManager(const std::string &command) 26 | { 27 | m_pipe = popen(command.c_str(), "r"); 28 | 29 | if(m_pipe == NULL) 30 | { 31 | MY_THROW("Can't open pipe for command '" << command << "'!"); 32 | } 33 | } 34 | //------------------------------------------------------------------------------ 35 | PipeManager::~PipeManager() 36 | { 37 | if(m_pipe != NULL) 38 | { 39 | pclose(m_pipe); 40 | } 41 | } 42 | //------------------------------------------------------------------------------ 43 | int PipeManager::Close() 44 | { 45 | if(m_pipe) 46 | { 47 | int exitCode = pclose(m_pipe); 48 | m_pipe = NULL; 49 | return exitCode; 50 | } 51 | else 52 | { 53 | MY_THROW("Pipe not open!"); 54 | } 55 | } 56 | //------------------------------------------------------------------------------ 57 | bool PipeManager::GetLine(std::string &line) 58 | { 59 | line = ""; 60 | int letter = '\0'; 61 | 62 | while(not feof(m_pipe)) 63 | { 64 | letter = fgetc(m_pipe); 65 | 66 | if(letter == '\n' || letter == '\r') 67 | { 68 | return 1; 69 | } 70 | else if(letter == EOF) 71 | { 72 | return 0; 73 | } 74 | else 75 | { 76 | line += letter; 77 | } 78 | } 79 | 80 | return 1; 81 | } 82 | //------------------------------------------------------------------------------ 83 | std::string PipeManager::GetLine() 84 | { 85 | std::string str; 86 | GetLine(str); 87 | return str; 88 | } 89 | //------------------------------------------------------------------------------ 90 | bool PipeManager::IsEof() const 91 | { 92 | return feof(m_pipe); 93 | } 94 | //------------------------------------------------------------------------------ 95 | int GetProcessOutput(const std::string &command, std::string &str) 96 | { 97 | str = ""; 98 | PipeManager pipe(command); 99 | while(! pipe.IsEof()) 100 | { 101 | str += pipe.GetLine() + "\n"; 102 | } 103 | 104 | if(!str.empty()) 105 | { 106 | str.erase(str.end() - 1); 107 | } 108 | 109 | return pipe.Close(); 110 | } 111 | //------------------------------------------------------------------------------ 112 | -------------------------------------------------------------------------------- /src/MainFrame.cpp: -------------------------------------------------------------------------------- 1 | ///File : MainFrame.cpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "MainFrame.hpp" 21 | 22 | #include 23 | //------------------------------------------------------------------------------ 24 | 25 | MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(NULL, -1, title, pos, size, style) 26 | { 27 | // Presentation général 28 | wxString ImgFileName; 29 | #if defined(__WXMSW__) 30 | SetIcon(wxIcon(_T("win32icon"))); 31 | #elif defined(__UNIX__) 32 | ImgFileName = findFile(_T("data/icon.png")); 33 | if(wxFileExists(ImgFileName)) 34 | { 35 | SetIcon(wxIcon(ImgFileName, wxBITMAP_TYPE_PNG)); 36 | } 37 | #endif //#ifdef WIN32 38 | 39 | // File menu 40 | wxMenu *FileMenu = new wxMenu; 41 | m_menuItemShowAll = new wxMenuItem(FileMenu, wxID_ANY, wxString(_("Show all drives")) + _T("\tCtrl+A"), _("Show all drives, even those not detected as USB stick."), wxITEM_CHECK); 42 | FileMenu->Append(m_menuItemShowAll); 43 | 44 | FileMenu->AppendSeparator(); 45 | FileMenu->Append(wxID_EXIT); 46 | 47 | // Help Menu 48 | wxMenu *HelpMenu = new wxMenu; 49 | HelpMenu->Append(wxID_ABOUT); 50 | 51 | // Menubar 52 | m_MenuBar = new wxMenuBar(); 53 | m_MenuBar->Append(FileMenu,_("&File")); 54 | m_MenuBar->Append(HelpMenu,_("&Help")); 55 | 56 | SetMenuBar(m_MenuBar); 57 | 58 | // Body 59 | wxBoxSizer* MainSizer = new wxBoxSizer( wxVERTICAL ); 60 | 61 | m_MainPanel = new MainPanel(this ,wxID_ANY); 62 | MainSizer->Add(m_MainPanel, 1, wxEXPAND | wxALL, 4); 63 | 64 | SetSizer( MainSizer ); 65 | 66 | // Events 67 | Connect( m_menuItemShowAll->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainPanel::OnShowAllDrive), NULL, m_MainPanel); 68 | 69 | Connect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnQuit)); 70 | Connect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAbout)); 71 | } 72 | //------------------------------------------------------------------------------ 73 | void MainFrame::OnQuit(wxCommandEvent& event) 74 | { 75 | Close(true); 76 | } 77 | //------------------------------------------------------------------------------ 78 | bool MainFrame::IsShowAllChecked() const 79 | { 80 | return m_menuItemShowAll->IsChecked(); 81 | } 82 | //------------------------------------------------------------------------------ 83 | void MainFrame::OnAbout(wxCommandEvent& event) 84 | { 85 | DialogAbout MyDialogAbout(this, wxID_ANY); 86 | MyDialogAbout.ShowModal(); 87 | } 88 | //------------------------------------------------------------------------------ 89 | -------------------------------------------------------------------------------- /src/locale/woeusb.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: woeusb\n" 4 | "Report-Msgid-Bugs-To: WoeUSB Issue Tracker \n" 5 | "POT-Creation-Date: 2011-07-14 00:07+0100\n" 6 | "PO-Revision-Date: 2011-07-14 00:07+0100\n" 7 | "Last-Translator: GILLE Colin \n" 8 | "Language-Team: WoeUSB Issue Tracker \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-SourceCharset: utf-8\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SearchPath-0: ..\n" 16 | 17 | #: ../MainFrame.cpp:41 18 | msgid "Show all drives" 19 | msgstr "" 20 | 21 | #: ../MainFrame.cpp:41 22 | msgid "Show all drives, even those not detected as USB stick." 23 | msgstr "" 24 | 25 | #: ../MainFrame.cpp:53 26 | msgid "&File" 27 | msgstr "" 28 | 29 | #: ../MainFrame.cpp:54 30 | msgid "&Help" 31 | msgstr "" 32 | 33 | #: ../App.cpp:82 34 | msgid "Error : " 35 | msgstr "" 36 | 37 | #: ../App.cpp:82 38 | #: ../App.cpp:124 39 | msgid "Error..." 40 | msgstr "" 41 | 42 | #: ../App.cpp:117 43 | msgid "Unknown error as occured!" 44 | msgstr "" 45 | 46 | #: ../App.cpp:124 47 | msgid "Fatal error : " 48 | msgstr "" 49 | 50 | #: ../DialogAbout.cpp:46 51 | #, c-format 52 | msgid "Version %s" 53 | msgstr "" 54 | 55 | #: ../DialogAbout.cpp:55 56 | msgid "Developer" 57 | msgstr "" 58 | 59 | #: ../DialogAbout.cpp:58 60 | #, c-format 61 | msgid "" 62 | "%s is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n" 63 | "\n" 64 | "%s 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 theGNU General Public License for more details.\n" 65 | "\n" 66 | "You should have received a copy of the GNU General Public Licensealong with %s. If not, see ." 67 | msgstr "" 68 | 69 | #: ../DialogAbout.cpp:73 70 | msgid "License" 71 | msgstr "" 72 | 73 | #: ../MainPanel.cpp:45 74 | msgid "Source :" 75 | msgstr "" 76 | 77 | #: ../MainPanel.cpp:48 78 | msgid "From a disk image (iso)" 79 | msgstr "" 80 | 81 | #: ../MainPanel.cpp:53 82 | msgid "Please select a disk image" 83 | msgstr "" 84 | 85 | #: ../MainPanel.cpp:58 86 | msgid "From a CD/DVD drive" 87 | msgstr "" 88 | 89 | #: ../MainPanel.cpp:70 90 | msgid "Target device :" 91 | msgstr "" 92 | 93 | #: ../MainPanel.cpp:81 94 | msgid "Install" 95 | msgstr "" 96 | 97 | #: ../MainPanel.cpp:247 98 | msgid "Installing.." 99 | msgstr "" 100 | 101 | #: ../MainPanel.cpp:247 102 | msgid "Please wait..." 103 | msgstr "" 104 | 105 | #: ../MainPanel.cpp:270 106 | #: ../MainPanel.cpp:289 107 | msgid "Are you sure you want to cancel the installation?" 108 | msgstr "" 109 | 110 | #: ../MainPanel.cpp:270 111 | #: ../MainPanel.cpp:289 112 | msgid "Cancel" 113 | msgstr "" 114 | 115 | #: ../MainPanel.cpp:312 116 | msgid "Installation succeded!" 117 | msgstr "" 118 | 119 | #: ../MainPanel.cpp:312 120 | #: ../MainPanel.cpp:316 121 | msgid "Installation" 122 | msgstr "" 123 | 124 | #: ../MainPanel.cpp:316 125 | msgid "Installation failed!" 126 | msgstr "" 127 | 128 | #: ../findFile.cpp:54 129 | msgid "File not Found : " 130 | msgstr "" 131 | 132 | #: ../findFile.cpp:54 133 | msgid "Error" 134 | msgstr "" 135 | 136 | #: ../strWxStdConv.hpp:106 137 | msgid "bytes" 138 | msgstr "" 139 | 140 | #: ../AppConfig.hpp:7 141 | msgid "WoeUSB" 142 | msgstr "" 143 | 144 | #: ../DialogAbout.hpp:68 145 | msgid "About" 146 | msgstr "" 147 | 148 | -------------------------------------------------------------------------------- /src/woeusb.1: -------------------------------------------------------------------------------- 1 | .TH woeusb 1 "@@WOEUSB_VERSION@@" "WoeUSB" "WoeUSB User Manual" 2 | .SH NAME 3 | woeusb \- Bootable Windows installation/PE USB storage creator 4 | 5 | .SH SYNOPSIS 6 | .B woeusb 7 | [OPTIONS] --device|--partition 8 | .I source_media target_media 9 | 10 | .SH DESCRIPTION 11 | .B woeusb 12 | is a command-line utility that enables you to create your own bootable Windows installation USB storage device from an existing Windows Installation DVD or its ISO image. 13 | .PP 14 | 15 | It mainly extracts all files from 16 | .I source_media 17 | to 18 | .I target_media 19 | , then installs GNU GRUB bootloader and a small configuration into it to support chainloading Windows BOOTMGR. 20 | .PP 21 | 22 | It also supports UEFI bootstrap scheme, however in this case Windows UEFI bootloader is used instead. 23 | .PP 24 | 25 | .SH COMMAND\-LINE OPTIONS 26 | .SS CREATION METHOD 27 | .TP 28 | \fB--device\fR / \fB-d\fR \fIsource_media\fR \fItarget_device\fR 29 | Drop 30 | .I target_device 31 | \'s partition table(if there's any), create a new PC/Legacy/MBR partition table, create a FAT32/NTFS partition spanning (almost) the entire disk, then setup bootable Windows on it. 32 | 33 | WARNING: ALL PREVIOUS DATA ON \fItarget_device\fR WILL BE DROPPED! 34 | 35 | .TP 36 | \fB--partition\fR / \fB-p\fR \fIsource_media\fR \fItarget_partition\fR 37 | Mount 38 | .I target_partition 39 | \'s file system, extracts all files from 40 | .I source_media 41 | into it, then make it bootable. 42 | 43 | WARNING: ALL FILES EXISTING ON \fItarget_partition\fR WITH THE SAME FILENAME IN \fIsource_media\fR WILL BE OVERWRITTEN! 44 | 45 | .SS MISCELLANEOUS 46 | .TP 47 | .B --help / -h 48 | Print application help message 49 | .TP 50 | .B --version / -V 51 | Print application version 52 | .TP 53 | .B --about / -ab 54 | Print info about this application 55 | .TP 56 | .B --verbose / -v 57 | Be more verbose 58 | .TP 59 | .B --debug 60 | Enable script debugging 61 | .TP 62 | .B --no-color 63 | Disable message coloring 64 | .TP 65 | \fB--label\fR / \fB-l\fR \fIfilesystem_label\fR 66 | Specify label for the newly created file system in 67 | .B --device 68 | creation method 69 | 70 | Note that the label is not verified for validity and may be illegal for the filesystem 71 | .TP 72 | .B --workaround-bios-boot-flag 73 | Apply workaround for buggy BIOSes that doesn't consider a device bootable if none of its partition's boot flag is toggled. 74 | .TP 75 | \fB--debugging-internal-function-call\fR \fIfunction_name (function_parameters...)\fR 76 | Development option for developers to test certain function without running the entire build 77 | .TP 78 | \fB--target-filesystem\fR / \fB--tgt-fs\fR \fIfilesystem_name\fR 79 | Specify the filesystem to use as the target partition's filesystem. 80 | Currently supported: FAT(default)/NTFS 81 | 82 | .SH EXAMPLES 83 | We love examples! 84 | 85 | Completely DESTROY all previous data on a USB storage device, recreate the partition table and the target partition, copy the Windows files, and make it bootable 86 | .EX 87 | # woeusb --device win7_amd64.iso /dev/sdX 88 | # woeusb --device /dev/sr0 /dev/sdX 89 | .EE 90 | 91 | Copy Windows files to an existing FAT partition of a USB storage device and make it bootable 92 | .EX 93 | # woeusb --partition win7_amd64.iso /dev/sdX1 94 | # woeusb --partition /dev/sr0 /dev/sdX1 95 | .EE 96 | 97 | .SH EXIT STATUS 98 | 0 when success, 1 (and non-zero if there's any) when failure 99 | 100 | .SH BUGS 101 | Refer to our 102 | .UR https://github.com/slacka/WoeUSB/issues 103 | issue tracker 104 | .UE 105 | for any known issues 106 | .br 107 | 108 | .SH SEE ALSO 109 | woeusbgui(1) 110 | 111 | .SH AUTHORS 112 | Colin GILLE / congelli501 113 | .br 114 | 林博仁 115 | -------------------------------------------------------------------------------- /filters/clean-version.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #shellcheck disable=SC2034 3 | 4 | ## Makes debuggers' life easier - Unofficial Bash Strict Mode 5 | ## BASHDOC: Shell Builtin Commands - Modifying Shell Behavior - The Set Builtin 6 | set -o errexit 7 | set -o errtrace 8 | set -o nounset 9 | set -o pipefail 10 | 11 | ## Non-overridable Primitive Variables 12 | ## BASHDOC: Shell Variables » Bash Variables 13 | ## BASHDOC: Basic Shell Features » Shell Parameters » Special Parameters 14 | if [ -v "BASH_SOURCE[0]" ]; then 15 | RUNTIME_EXECUTABLE_PATH="$(realpath --strip "${BASH_SOURCE[0]}")" 16 | RUNTIME_EXECUTABLE_FILENAME="$(basename "${RUNTIME_EXECUTABLE_PATH}")" 17 | RUNTIME_EXECUTABLE_NAME="${RUNTIME_EXECUTABLE_FILENAME%.*}" 18 | RUNTIME_EXECUTABLE_DIRECTORY="$(dirname "${RUNTIME_EXECUTABLE_PATH}")" 19 | RUNTIME_COMMANDLINE_BASECOMMAND="${0}" 20 | declare -r\ 21 | RUNTIME_EXECUTABLE_FILENAME\ 22 | RUNTIME_EXECUTABLE_DIRECTORY\ 23 | RUNTIME_EXECUTABLE_PATHABSOLUTE\ 24 | RUNTIME_COMMANDLINE_BASECOMMAND 25 | fi 26 | declare -ar RUNTIME_COMMANDLINE_PARAMETERS=("${@}") 27 | 28 | ## init function: entrypoint of main program 29 | ## This function is called near the end of the file, 30 | ## with the script's command-line parameters as arguments 31 | init(){ 32 | if ! process_commandline_parameters; then 33 | printf\ 34 | "Error: %s: Invalid command-line parameters.\n"\ 35 | "${FUNCNAME[0]}"\ 36 | 1>&2 37 | print_help 38 | exit 1 39 | fi 40 | 41 | sed\ 42 | --regexp-extended\ 43 | "s/[0-9]+\.[0-9]+\.[0-9]+[^)\"']*/@@WOEUSB_VERSION@@/" 44 | exit 0 45 | }; declare -fr init 46 | 47 | ## Traps: Functions that are triggered when certain condition occurred 48 | ## Shell Builtin Commands » Bourne Shell Builtins » trap 49 | trap_errexit(){ 50 | printf "An error occurred and the script is prematurely aborted\n" 1>&2 51 | return 0 52 | }; declare -fr trap_errexit; trap trap_errexit ERR 53 | 54 | trap_exit(){ 55 | return 0 56 | }; declare -fr trap_exit; trap trap_exit EXIT 57 | 58 | trap_return(){ 59 | local returning_function="${1}" 60 | 61 | printf "DEBUG: %s: returning from %s\n" "${FUNCNAME[0]}" "${returning_function}" 1>&2 62 | }; declare -fr trap_return 63 | 64 | trap_interrupt(){ 65 | printf "Recieved SIGINT, script is interrupted.\n" 1>&2 66 | return 0 67 | }; declare -fr trap_interrupt; trap trap_interrupt INT 68 | 69 | print_help(){ 70 | printf "Currently no help messages are available for this program\n" 1>&2 71 | return 0 72 | }; declare -fr print_help; 73 | 74 | process_commandline_parameters() { 75 | if [ "${#RUNTIME_COMMANDLINE_PARAMETERS[@]}" -eq 0 ]; then 76 | return 0 77 | fi 78 | 79 | # modifyable parameters for parsing by consuming 80 | local -a parameters=("${RUNTIME_COMMANDLINE_PARAMETERS[@]}") 81 | 82 | # Normally we won't want debug traces to appear during parameter parsing, so we add this flag and defer it activation till returning(Y: Do debug) 83 | local enable_debug=N 84 | 85 | while true; do 86 | if [ "${#parameters[@]}" -eq 0 ]; then 87 | break 88 | else 89 | case "${parameters[0]}" in 90 | "--help"\ 91 | |"-h") 92 | print_help; 93 | exit 0 94 | ;; 95 | "--debug"\ 96 | |"-d") 97 | enable_debug="Y" 98 | ;; 99 | *) 100 | printf "ERROR: Unknown command-line argument \"%s\"\n" "${parameters[0]}" >&2 101 | return 1 102 | ;; 103 | esac 104 | # shift array by 1 = unset 1st then repack 105 | unset "parameters[0]" 106 | if [ "${#parameters[@]}" -ne 0 ]; then 107 | parameters=("${parameters[@]}") 108 | fi 109 | fi 110 | done 111 | 112 | if [ "${enable_debug}" = "Y" ]; then 113 | trap 'trap_return "${FUNCNAME[0]}"' RETURN 114 | set -o xtrace 115 | fi 116 | return 0 117 | }; declare -fr process_commandline_parameters; 118 | 119 | init "${@}" 120 | 121 | ## This script is based on the GNU Bash Shell Script Template project 122 | ## https://github.com/Lin-Buo-Ren/GNU-Bash-Shell-Script-Template 123 | ## and is based on the following version: 124 | declare -r META_BASED_ON_GNU_BASH_SHELL_SCRIPT_TEMPLATE_VERSION="v1.26.0-32-g317af27-dirty" 125 | ## You may rebase your script to incorporate new features and fixes from the template -------------------------------------------------------------------------------- /src/MyException.hpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | /* 3 | This file is part of WoeUSB. 4 | 5 | WoeUSB is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | WoeUSB is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with WoeUSB. If not, see . 17 | */ 18 | //------------------------------------------------------------------------------ 19 | #if not defined MY_EXCEPTION_HPP_WINUSBGUI 20 | #define MY_EXCEPTION_HPP_WINUSBGUI 21 | //------------------------------------------------------------------------------ 22 | #include 23 | #include 24 | #include 25 | #include 26 | //------------------------------------------------------------------------------ 27 | // FIXME: Retirer la ligne cerr ! 28 | #define MY_THROW(what) \ 29 | { \ 30 | std::ostringstream sstring; \ 31 | sstring << "Error from '" << __FILE__ << "' at line " << __LINE__ << "\nDescription: " << what; \ 32 | throw En::MyException(sstring.str()); \ 33 | } \ 34 | //------------------------------------------------------------------------------ 35 | #define MY_CATCH_LUA_CERR() \ 36 | catch(luabind::error &e) \ 37 | { \ 38 | cerr << "Failed to run lua function!" << endl; \ 39 | cerr << "LUA error (error) :\n" << lua_tostring(Global::GetLuaState(), -1) << endl; \ 40 | cerr << "What: " << e.what() << endl; \ 41 | } \ 42 | catch(luabind::cast_failed &e) \ 43 | { \ 44 | cerr << "Failed to run lua function!" << endl; \ 45 | cerr << "LUA error (cast_failed) :\n" << lua_tostring(Global::GetLuaState(), -1) << endl; \ 46 | cerr << "What: " << e.what() << endl; \ 47 | } \ 48 | catch(std::exception &e) \ 49 | { \ 50 | cerr << "Failed to run lua function (std::exception)!" << endl; \ 51 | cerr << "What: " << e.what() << endl; \ 52 | } 53 | //------------------------------------------------------------------------------ 54 | namespace En 55 | { 56 | //------------------------------------------------------------------------------ 57 | class MyException : public std::exception 58 | { 59 | public: 60 | MyException(const std::string &info) throw(); 61 | virtual ~MyException() throw(); 62 | virtual const char* what() const throw(); 63 | 64 | private: 65 | std::string m_info; 66 | }; 67 | //------------------------------------------------------------------------------ 68 | } // namespace En 69 | //------------------------------------------------------------------------------ 70 | #endif // MY_EXCEPTION_HPP_WINUSBGUI 71 | -------------------------------------------------------------------------------- /src/App.cpp: -------------------------------------------------------------------------------- 1 | ///File : App.cpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "config.hpp" 21 | 22 | #if USE_LIBNOTIFY == 1 23 | #include 24 | #endif 25 | 26 | #include "strWxStdConv.hpp" 27 | 28 | #include "App.hpp" 29 | //------------------------------------------------------------------------------ 30 | IMPLEMENT_APP(App) 31 | 32 | #ifdef __WXMAC__ 33 | #include 34 | #endif 35 | //------------------------------------------------------------------------------ 36 | bool App::OnInit() 37 | { 38 | #ifdef __WXMAC__ 39 | ProcessSerialNumber PSN; 40 | GetCurrentProcess(&PSN); 41 | TransformProcessType(&PSN,kProcessTransformToForegroundApplication); 42 | #endif 43 | 44 | // Création du Handler pour les images (permet de les ouvrir)... 45 | wxInitAllImageHandlers(); 46 | 47 | // Gestion de la langue 48 | // Ajout des préfixes possibles de chemins d'accès aux catalogues 49 | wxLocale::AddCatalogLookupPathPrefix(findFile(_T("locale"))); 50 | 51 | // Mise en place de la langue par défaut du système 52 | m_locale.Init(wxLANGUAGE_DEFAULT); 53 | { 54 | wxLogNull noLog; // Supprime les erreurs si les catalogues n'existent pas 55 | // Catalogue de l'application 56 | m_locale.AddCatalog(_T("trad")); 57 | // Catalogue de wxWidgets 58 | m_locale.AddCatalog(_T("wxstd")); 59 | } 60 | 61 | #if USE_LIBNOTIFY == 1 62 | if(!notify_init(StrWxToStd(PROG_FULL_NAME_GETTEXT).c_str())) 63 | { 64 | std::cerr << "Lib notify not initialised!" << std::endl; 65 | return false; 66 | } 67 | #endif 68 | 69 | try 70 | { 71 | wxString frameTitle = PROG_FULL_NAME_GETTEXT; 72 | #if DEBUG == 1 73 | frameTitle += _T(" - Debug"); 74 | #endif 75 | 76 | m_frame = new MainFrame(frameTitle, wxDefaultPosition, wxSize(400, 500)); 77 | m_frame->SetMinSize(wxSize(300, 300)); 78 | m_frame->Show(true); 79 | } 80 | catch(const std::exception& e) //Rattrape toutes les exceptions 81 | { 82 | wxMessageBox(_("Error : ") + wxString(e.what(), wxConvUTF8), _("Error..."), wxOK | wxICON_ERROR); 83 | exit(1); 84 | } 85 | 86 | return true; 87 | } 88 | //------------------------------------------------------------------------------ 89 | int App::OnRun() 90 | { 91 | bool isException = false; 92 | wxString msg; 93 | 94 | int code = 0; 95 | 96 | try 97 | { 98 | code = wxApp::OnRun(); 99 | } 100 | catch(const std::exception& e) //Rattrape toutes les exceptions 101 | { 102 | isException = true; 103 | msg = wxString(e.what(), wxConvUTF8); 104 | } 105 | catch(int errCode) 106 | { 107 | msg << _T("Error \"") << errCode << _T("\" has occurred!"); 108 | isException = true; 109 | } 110 | catch(wxString info) 111 | { 112 | msg = info; 113 | isException = true; 114 | } 115 | catch(...) 116 | { 117 | msg = _("Unknown error as occurred!"); 118 | isException = true; 119 | } 120 | 121 | if(isException) 122 | { 123 | std::cerr << msg << std::endl; 124 | wxMessageBox(_("Fatal error : ") + wxString(_T("\n")) + msg, _("Error..."), wxOK | wxICON_ERROR, m_frame); 125 | return 1; 126 | } 127 | 128 | return code; 129 | } 130 | //------------------------------------------------------------------------------ 131 | -------------------------------------------------------------------------------- /src/locale/zh_TW/LC_MESSAGES/woeusb.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: winusb\n" 4 | "Report-Msgid-Bugs-To: WoeUSB Issue Tracker \n" 5 | "POT-Creation-Date: 2011-07-14 00:08+0100\n" 6 | "PO-Revision-Date: 2016-07-09 20:51+0800\n" 7 | "Last-Translator: V字龍 \n" 8 | "Language-Team: chinese-l10n \n" 9 | "Language: zh_TW\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-SourceCharset: UTF-8\n" 14 | "X-Poedit-Basepath: .\n" 15 | "Plural-Forms: nplurals=1; plural=0;\n" 16 | "X-Generator: Poedit 1.8.7.1\n" 17 | "X-Poedit-SearchPath-0: ../../..\n" 18 | 19 | #: ../../../MainFrame.cpp:41 20 | msgid "Show all drives" 21 | msgstr "秀出所有磁碟機" 22 | 23 | #: ../../../MainFrame.cpp:41 24 | msgid "Show all drives, even those not detected as USB stick." 25 | msgstr "秀出所有磁碟機,就算沒有識別為 USB 記憶碟也一樣。" 26 | 27 | #: ../../../MainFrame.cpp:53 28 | msgid "&File" 29 | msgstr "檔案(&F)" 30 | 31 | #: ../../../MainFrame.cpp:54 32 | msgid "&Help" 33 | msgstr "尋求幫助(&H)" 34 | 35 | #: ../../../App.cpp:82 36 | msgid "Error : " 37 | msgstr "錯誤:" 38 | 39 | #: ../../../App.cpp:82 ../../../App.cpp:124 40 | msgid "Error..." 41 | msgstr "錯誤……" 42 | 43 | #: ../../../App.cpp:117 44 | msgid "Unknown error as occurred!" 45 | msgstr "發生了未知的錯誤!" 46 | 47 | #: ../../../App.cpp:124 48 | msgid "Fatal error : " 49 | msgstr "致命錯誤:" 50 | 51 | #: ../../../DialogAbout.cpp:46 52 | #, c-format 53 | msgid "Version %s" 54 | msgstr "第 %s 版" 55 | 56 | #: ../../../DialogAbout.cpp:55 57 | msgid "Developer" 58 | msgstr "軟體開發者" 59 | 60 | #: ../../../DialogAbout.cpp:58 61 | #, c-format 62 | msgid "" 63 | "%s 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 3 of the License, or (at your option) any later version.\n" 64 | "\n" 65 | "%s 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 theGNU General Public License for more details.\n" 66 | "\n" 67 | "You should have received a copy of the GNU General Public Licensealong with %s. If not, see ." 68 | msgstr "" 69 | "%s 為自由軟體:您可以在 Free Software Foundation 所發表的 GNU General Public License 授權條款第 3 版或任意(您所中意之)更近期版本的規定下進行本軟體的再散佈與修改。\n" 70 | "\n" 71 | "%s 以其會有所用的期望下而散佈,但**不做任何擔保**;甚至於不包含暗示其對於**商業價值**或是**特定需求的適用性**的保證。更多相關細節請參考 GNU General Public License 授權條款。\n" 72 | "\n" 73 | "您應該已經隨 %s 得到一份 GNU General Public License 授權條款的副本。如果沒有的話請上 瀏覽。" 74 | 75 | #: ../../../DialogAbout.cpp:73 76 | msgid "License" 77 | msgstr "授權條款" 78 | 79 | #: ../../../MainPanel.cpp:45 80 | msgid "Source :" 81 | msgstr "來源可開機媒體:" 82 | 83 | #: ../../../MainPanel.cpp:48 84 | msgid "From a disk image (iso)" 85 | msgstr "從一個光碟映像檔(iso)" 86 | 87 | #: ../../../MainPanel.cpp:53 88 | msgid "Please select a disk image" 89 | msgstr "請選取一個光碟映像檔" 90 | 91 | #: ../../../MainPanel.cpp:58 92 | msgid "From a CD/DVD drive" 93 | msgstr "從一個 CD/DVD 光碟機" 94 | 95 | #: ../../../MainPanel.cpp:70 96 | msgid "Target device :" 97 | msgstr "目標裝置:" 98 | 99 | #: ../../../MainPanel.cpp:81 100 | msgid "Install" 101 | msgstr "開始安裝" 102 | 103 | #: ../../../MainPanel.cpp:247 104 | msgid "Installing.." 105 | msgstr "正在安裝……" 106 | 107 | #: ../../../MainPanel.cpp:247 108 | msgid "Please wait..." 109 | msgstr "請稍候……" 110 | 111 | #: ../../../MainPanel.cpp:270 ../../../MainPanel.cpp:289 112 | msgid "Are you sure you want to cancel the installation?" 113 | msgstr "請問您確定要取消安裝程序嗎?" 114 | 115 | #: ../../../MainPanel.cpp:270 ../../../MainPanel.cpp:289 116 | msgid "Cancel" 117 | msgstr "取消" 118 | 119 | #: ../../../MainPanel.cpp:312 120 | msgid "Installation succeeded!" 121 | msgstr "安裝成功!" 122 | 123 | #: ../../../MainPanel.cpp:312 ../../../MainPanel.cpp:316 124 | msgid "Installation" 125 | msgstr "安裝程序" 126 | 127 | #: ../../../MainPanel.cpp:316 128 | msgid "Installation failed!" 129 | msgstr "安裝失敗!" 130 | 131 | #: ../../../findFile.cpp:54 132 | msgid "File not Found : " 133 | msgstr "找不到檔案:" 134 | 135 | #: ../../../findFile.cpp:54 136 | msgid "Error" 137 | msgstr "錯誤" 138 | 139 | #: ../../../strWxStdConv.hpp:106 140 | msgid "bytes" 141 | msgstr "位元組" 142 | 143 | #: ../../../AppConfig.hpp:7 144 | msgid "WinUSB" 145 | msgstr "WinUSB Windows 可開機 USB 製作工具" 146 | 147 | #: ../../../DialogAbout.hpp:68 148 | msgid "About" 149 | msgstr "關於本軟體" 150 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WoeUSB 2 | [![Latest Release](https://img.shields.io/github/release/slacka/WoeUSB.svg)](https://github.com/slacka/WoeUSB/releases) 3 | [![WoeUSB License](https://img.shields.io/badge/license-gpl-blue.svg)](https://github.com/slacka/WoeUSB/blob/master/COPYING) 4 | [![Build Status](https://travis-ci.org/slacka/WoeUSB.svg?branch=master)](https://travis-ci.org/slacka/WoeUSB) 5 | 6 | ![brand](src/data/woeusb-logo.png)[![thumbnail of GUI wrapper screenshot](dev/woeusbgui-screenshot.thumbnail.png)](dev/woeusbgui-screenshot.png)[![thumbnail of CLI application screenshot](dev/woeusb-screenshot.thumbnail.png)](dev/woeusb-screenshot.png) 7 | 8 | _A Linux program to create a Windows USB stick installer from a real Windows DVD or image._ 9 | 10 | This package contains two programs: 11 | 12 | * woeusb: A command-line utility that enables you to create your own bootable Windows installation USB storage device from an existing Windows Installation disc or disk image 13 | * woeusbgui: A GUI wrapper of woeusb based on WxWidgets 14 | 15 | Supported images: 16 | 17 | Windows Vista, Windows 7, Window 8.x, Windows 10. All languages and any version (home, pro...) and Windows PE are supported. 18 | 19 | Supported bootmodes: 20 | 21 | * Legacy/MBR-style/IBM PC compatible bootmode 22 | * Native UEFI booting is supported for Windows 7 and later images (limited to the FAT filesystem as the target) 23 | 24 | This project is a fork of [Congelli501's WinUSB software](http://en.congelli.eu/prog_info_winusb.html), which has not been maintained since 2012, according to the official website. 25 | 26 | ## Installation 27 | ### Prebuilt Packages 28 | Note that prebuilt packages are not necessarily the latest release and we are NOT responsible for the trustworthiness of these packages. Regarding any related issues contact its maintainer first. 29 | 30 | #### Official Distribution Packages 31 | * [Fedora](https://src.fedoraproject.org/rpms/WoeUSB) packages maintained by mprahl 32 | * [openSUSE](https://software.opensuse.org/package/WoeUSB) packages maintained by [guoyunhe](https://guoyunhe.me/) 33 | * [Gentoo](https://packages.gentoo.org/packages/sys-boot/woeusb) packages maintained by pacho 34 | 35 | #### Third-party Distribution Packages 36 | * [Arch Linux](https://aur.archlinux.org/packages/woeusb-git/) packages maintained by darkfm 37 | * [Ubuntu](https://launchpad.net/%7Enilarimogard/+archive/ubuntu/webupd8) packages maintained by [WebUpd8](http://www.webupd8.org/) 38 | * [Debian](https://software.opensuse.org//download.html?project=home%3AProvessor&package=woeusb) packages maintained by provessor 39 | 40 | ### Build from Source 41 | The following are the instructions to install WoeUSB if prebuilt version is not available or too old. 42 | 43 | #### Acquire WoeUSB's Source Code 44 | Clone WoeUSB's Git repository to your local machine using `git clone https://github.com/slacka/WoeUSB.git` 45 | 46 | NOTE: We no longer support building from source archives provided in the GitHub Releases page as the software version is not set. 47 | 48 | #### Setting the Application Version String 49 | This step is required for generating the proper version name based on the Git tags. This step should be repeated if the version is changed. 50 | 51 | ```shell 52 | $ ./setup-development-environment.bash 53 | ``` 54 | 55 | #### Install WoeUSB's Build Dependencies 56 | ```shell 57 | # For Debian-based distributions (NOTE: For your convenience, this package is already provided in the release page) 58 | $ sudo apt-get install devscripts equivs gdebi-core 59 | $ cd 60 | $ mk-build-deps # NOTE: Currently, due to Debian Bug #679101, this command will fail if the source path contains spaces. 61 | $ sudo gdebi woeusb-build-deps__all.deb 62 | 63 | # For Fedora > 22 64 | $ sudo dnf install wxGTK3-devel 65 | 66 | # For Fedora 22 67 | $ sudo dnf install wxGTK-devel dh-autoreconf.noarch 68 | 69 | # For Opensuse 70 | $ sudo zypper in wxGTK3-3_2-devel dh-autoreconf devscripts 71 | ``` 72 | #### Build & Install WoeUSB 73 | ```shell 74 | # For Debian-based distributions 75 | $ dpkg-buildpackage -uc -b # NOTE: Currently, due to a bug in the build system, this command will fail if the source's path contains space or single quotes, refer to issue #84 for details 76 | $ sudo gdebi ../woeusb__.deb 77 | 78 | # Generic method 79 | $ autoreconf --force --install # Most non-Debian derived distros will need this 80 | $ ./configure 81 | $ make 82 | $ sudo make install 83 | ``` 84 | 85 | ## License 86 | WoeUSB is distributed under the [GPL license](https://github.com/slacka/WoeUSB/blob/master/COPYING). 87 | -------------------------------------------------------------------------------- /filters/smudge-version.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #shellcheck disable=SC2034 3 | 4 | ## Makes debuggers' life easier - Unofficial Bash Strict Mode 5 | ## BASHDOC: Shell Builtin Commands - Modifying Shell Behavior - The Set Builtin 6 | set -o errexit 7 | set -o errtrace 8 | set -o nounset 9 | set -o pipefail 10 | 11 | ## Non-overridable Primitive Variables 12 | ## BASHDOC: Shell Variables » Bash Variables 13 | ## BASHDOC: Basic Shell Features » Shell Parameters » Special Parameters 14 | if [ -v "BASH_SOURCE[0]" ]; then 15 | RUNTIME_EXECUTABLE_PATH="$(realpath --strip "${BASH_SOURCE[0]}")" 16 | RUNTIME_EXECUTABLE_FILENAME="$(basename "${RUNTIME_EXECUTABLE_PATH}")" 17 | RUNTIME_EXECUTABLE_NAME="${RUNTIME_EXECUTABLE_FILENAME%.*}" 18 | RUNTIME_EXECUTABLE_DIRECTORY="$(dirname "${RUNTIME_EXECUTABLE_PATH}")" 19 | RUNTIME_COMMANDLINE_BASECOMMAND="${0}" 20 | declare -r\ 21 | RUNTIME_EXECUTABLE_FILENAME\ 22 | RUNTIME_EXECUTABLE_DIRECTORY\ 23 | RUNTIME_EXECUTABLE_PATHABSOLUTE\ 24 | RUNTIME_COMMANDLINE_BASECOMMAND 25 | fi 26 | declare -ar RUNTIME_COMMANDLINE_PARAMETERS=("${@}") 27 | 28 | ## init function: entrypoint of main program 29 | ## This function is called near the end of the file, 30 | ## with the script's command-line parameters as arguments 31 | init(){ 32 | if ! process_commandline_parameters; then 33 | printf\ 34 | "Error: %s: Invalid command-line parameters.\n"\ 35 | "${FUNCNAME[0]}"\ 36 | 1>&2 37 | print_help 38 | exit 1 39 | fi 40 | 41 | declare version 42 | version="$(describe_this_version)" 43 | 44 | printf "%s: DEBUG: Use %s as this version's tag\n"\ 45 | "${RUNTIME_EXECUTABLE_NAME}"\ 46 | "${version}"\ 47 | 1>&2 48 | 49 | sed "s/@@WOEUSB_VERSION@@/${version/#v/}/" 50 | 51 | printf "DEBUG: %s is done\n"\ 52 | "${RUNTIME_EXECUTABLE_NAME}"\ 53 | 1>&2 54 | exit 0 55 | }; declare -fr init 56 | 57 | describe_this_version(){ 58 | git describe --tags --always 59 | return 0 60 | }; declare -fr describe_this_version 61 | 62 | ## Traps: Functions that are triggered when certain condition occurred 63 | ## Shell Builtin Commands » Bourne Shell Builtins » trap 64 | trap_errexit(){ 65 | printf "An error occurred and the script is prematurely aborted\n" 1>&2 66 | return 0 67 | }; declare -fr trap_errexit; trap trap_errexit ERR 68 | 69 | trap_exit(){ 70 | return 0 71 | }; declare -fr trap_exit; trap trap_exit EXIT 72 | 73 | trap_return(){ 74 | local returning_function="${1}" 75 | 76 | printf "DEBUG: %s: returning from %s\n" "${FUNCNAME[0]}" "${returning_function}" 1>&2 77 | }; declare -fr trap_return 78 | 79 | trap_interrupt(){ 80 | printf "Recieved SIGINT, script is interrupted.\n" 1>&2 81 | return 0 82 | }; declare -fr trap_interrupt; trap trap_interrupt INT 83 | 84 | print_help(){ 85 | printf "Currently no help messages are available for this program\n" 1>&2 86 | return 0 87 | }; declare -fr print_help; 88 | 89 | process_commandline_parameters() { 90 | if [ "${#RUNTIME_COMMANDLINE_PARAMETERS[@]}" -eq 0 ]; then 91 | return 0 92 | fi 93 | 94 | # modifyable parameters for parsing by consuming 95 | local -a parameters=("${RUNTIME_COMMANDLINE_PARAMETERS[@]}") 96 | 97 | # Normally we won't want debug traces to appear during parameter parsing, so we add this flag and defer it activation till returning(Y: Do debug) 98 | local enable_debug=N 99 | 100 | while true; do 101 | if [ "${#parameters[@]}" -eq 0 ]; then 102 | break 103 | else 104 | case "${parameters[0]}" in 105 | "--help"\ 106 | |"-h") 107 | print_help; 108 | exit 0 109 | ;; 110 | "--debug"\ 111 | |"-d") 112 | enable_debug="Y" 113 | ;; 114 | *) 115 | printf "ERROR: Unknown command-line argument \"%s\"\n" "${parameters[0]}" >&2 116 | return 1 117 | ;; 118 | esac 119 | # shift array by 1 = unset 1st then repack 120 | unset "parameters[0]" 121 | if [ "${#parameters[@]}" -ne 0 ]; then 122 | parameters=("${parameters[@]}") 123 | fi 124 | fi 125 | done 126 | 127 | if [ "${enable_debug}" = "Y" ]; then 128 | trap 'trap_return "${FUNCNAME[0]}"' RETURN 129 | set -o xtrace 130 | fi 131 | return 0 132 | }; declare -fr process_commandline_parameters; 133 | 134 | init "${@}" 135 | 136 | ## This script is based on the GNU Bash Shell Script Template project 137 | ## https://github.com/Lin-Buo-Ren/GNU-Bash-Shell-Script-Template 138 | ## and is based on the following version: 139 | declare -r META_BASED_ON_GNU_BASH_SHELL_SCRIPT_TEMPLATE_VERSION="v1.26.0-32-g317af27-dirty" 140 | ## You may rebase your script to incorporate new features and fixes from the template -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | This document explains how to contribute to this project in many aspects. Please make sure to read the relating sections thoroughly before making any contributions. 3 | 4 | ## Reporting Issues 5 | The so-called "issue" includes but is not limited to software bugs and suggestions 6 | 7 | ### Always Search for Duplicates Before Filing a New Issue 8 | There is a possibility that your issue has already been filed, so please search the issue tracker before filing a new one 9 | 10 | When searching, use keywords instead of full sentences. For example, search "crash unbounded variable" instead of "The program crashes with 'unbounded variable' message printed on screen". 11 | 12 | ### Report Software Bugs Effectively 13 | How you report software bugs greatly affects how fast it can be processed and fixed, refer to [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for more information 14 | 15 | ## Localize (Translate) the Software 16 | If you are fluent in a language other than English, you may help this project by translating it to your language. This is called localization or L10N for short. This software has already been internationalized so that it is capable of displaying different languages. 17 | 18 | Also, please consider translating our documentation to the language that you are fluent in. 19 | 20 | ## Improving Documentation 21 | The documentation of this project may be outdated through time, and needs help to keep it up to date. 22 | 23 | ### Manual Pages (manpages) 24 | Refer to the following articles for reference on writing manpages: 25 | 26 | * [Linux Man Page Howto](http://www.schweikhardt.net/man_page_howto.html) 27 | * [The GNU Troff Manual](https://www.gnu.org/software/groff/manual) 28 | - [The GNU Troff Manual: Macro Packages » man » Usage](https://www.gnu.org/software/groff/manual/html_node/Man-usage.html#Man-usage) 29 | - [The GNU Troff Manual: Escapes](https://www.gnu.org/software/groff/manual/html_node/Escapes.html#Escapes) 30 | - [The GNU Troff Manual: Fonts and Symbols](https://www.gnu.org/software/groff/manual/html_node/Fonts-and-Symbols.html#Fonts-and-Symbols) 31 | 32 | ## Improving Code 33 | There are so many aspects of the code that can be improved, however, please consider the following topics while doing so. 34 | 35 | ### Coding Style 36 | While we don't really have a strictly unifeid style throughout the codebsae, it is required to *mimic the coding style of the code in context*. 37 | 38 | #### Indentation 39 | This project uses tab characters for indentation as it's width can be flexibly configured in many text editors 40 | 41 | #### Padding Spaces 42 | * Padding is required for operators 43 | * Padding is avoided for the outer curly braces 44 | 45 | #### Word Separating Method 46 | NOTE: This currently only applies to the GNU Bash shell scripts. 47 | 48 | * Underscore for variable names 49 | * Underscore for function names 50 | 51 | ### Defensive Bash Programming 52 | * All parameters that are assigned a value should be declared as read-only parameter to remain unchanged throughout the code 53 | * All non-readonly parameters should be UNSET right after they are not used. 54 | * Function parameters should be caught by `local` parameters instead of directly referenced using positional parameter syntax 55 | * To increase code reusability, avoid referencing global variables from a function, alway pass it by function arguments 56 | 57 | ### Character Encoding of Plaintext Files 58 | [UTF-8 everywhere!](https://utf8everywhere.org) (Unless otherwise mandated by its specification) 59 | 60 | ## Promote This Project to Others 61 | It is appreciated if you share this project with others. Also, if you write an article about this project, plese [share it with us](https://github.com/slacka/WoeUSB/wiki/Public-Reactions), we'd love to hear about it! 62 | 63 | ## Design Artwork/Logos for This Software 64 | All current artwork is stored under src/data. **Please only use materials that are under a free license.** 65 | 66 | ## Guidelines in Using Git SCM 67 | ### Create Commits Based on Minimal Independent Changes 68 | Avoid creating commits that do multiple things at once as this will help other developers understand the change history. 69 | 70 | ### Write Comprehensible Commit Messages 71 | While we currently don't have a strict commit message style, we do have established some requirements: 72 | 73 | * Every contribution must conform to the [Developer Certificate of Origin](https://elinux.org/Developer_Certificate_Of_Origin), version 1.1 or more recent version, and is signed off using the `Signed-off-by: ` tag 74 | * Use English for commit messages 75 | 76 | For summary line format, [refer and mimic the commit log](https://github.com/slacka/WoeUSB/commits/master). Also check out the [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) article for additional info on writing commit messages. 77 | -------------------------------------------------------------------------------- /src/locale/fr/LC_MESSAGES/woeusb.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: woeusb\n" 4 | "Report-Msgid-Bugs-To: WoeUSB Issue Tracker \n" 5 | "POT-Creation-Date: 2011-07-14 00:08+0100\n" 6 | "PO-Revision-Date: 2011-07-14 00:13+0100\n" 7 | "Last-Translator: GILLE Colin \n" 8 | "Language-Team: WoeUSB Issue Tracker \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-SourceCharset: utf-8\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: French\n" 16 | "X-Poedit-Country: FRANCE\n" 17 | "X-Poedit-SearchPath-0: ../../..\n" 18 | 19 | #: ../../../MainFrame.cpp:41 20 | msgid "Show all drives" 21 | msgstr "Montrer tous les disques" 22 | 23 | #: ../../../MainFrame.cpp:41 24 | msgid "Show all drives, even those not detected as USB stick." 25 | msgstr "Montrer tous les disques, même ceux qui ne sont pas détectés comme des clés USB." 26 | 27 | #: ../../../MainFrame.cpp:53 28 | msgid "&File" 29 | msgstr "$Fichier" 30 | 31 | #: ../../../MainFrame.cpp:54 32 | msgid "&Help" 33 | msgstr "&Aide" 34 | 35 | #: ../../../App.cpp:82 36 | msgid "Error : " 37 | msgstr "Erreur :" 38 | 39 | #: ../../../App.cpp:82 40 | #: ../../../App.cpp:124 41 | msgid "Error..." 42 | msgstr "Erreur..." 43 | 44 | #: ../../../App.cpp:117 45 | msgid "Unknown error as occurred!" 46 | msgstr "Une erreur inconnue s'est produite!" 47 | 48 | #: ../../../App.cpp:124 49 | msgid "Fatal error : " 50 | msgstr "Erreur fatale :" 51 | 52 | #: ../../../DialogAbout.cpp:46 53 | #, c-format 54 | msgid "Version %s" 55 | msgstr "Version %s" 56 | 57 | #: ../../../DialogAbout.cpp:55 58 | msgid "Developer" 59 | msgstr "Développeur" 60 | 61 | #: ../../../DialogAbout.cpp:58 62 | #, c-format 63 | msgid "" 64 | "%s 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 3 of the License, or (at your option) any later version.\n" 65 | "\n" 66 | "%s 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 theGNU General Public License for more details.\n" 67 | "\n" 68 | "You should have received a copy of the GNU General Public Licensealong with %s. If not, see ." 69 | msgstr "" 70 | "%s est un logiciel libre ; vous pouvez le diffuser et/ou le modifier suivant les termes de la Licence Publique Générale GNU telle que publiée par la Free Software Foundation ; soit la version 3 de cette licence, soit (à votre convenance) une version ultérieure.\n" 71 | "\n" 72 | "%s est diffusé dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIALISATION ou d'ADÉQUATION À UN USAGE PARTICULIER. Voyez la Licence Publique Générale GNU pour plus de détails.\n" 73 | "\n" 74 | "Vous devriez avoir reçu une copie de la Licence Publique Générale GNU avec %s ; sinon, veuillez écrire à la Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, États-Unis." 75 | 76 | #: ../../../DialogAbout.cpp:73 77 | msgid "License" 78 | msgstr "Licence" 79 | 80 | #: ../../../MainPanel.cpp:45 81 | msgid "Source :" 82 | msgstr "Source :" 83 | 84 | #: ../../../MainPanel.cpp:48 85 | msgid "From a disk image (iso)" 86 | msgstr "Depuis une image disque (iso)" 87 | 88 | #: ../../../MainPanel.cpp:53 89 | msgid "Please select a disk image" 90 | msgstr "Veuillez sélectionner une image disque" 91 | 92 | #: ../../../MainPanel.cpp:58 93 | msgid "From a CD/DVD drive" 94 | msgstr "Depuis un lecteur de CD/DVD" 95 | 96 | #: ../../../MainPanel.cpp:70 97 | msgid "Target device :" 98 | msgstr "Disque de destination :" 99 | 100 | #: ../../../MainPanel.cpp:81 101 | msgid "Install" 102 | msgstr "Installer" 103 | 104 | #: ../../../MainPanel.cpp:247 105 | msgid "Installing.." 106 | msgstr "Installation en cours..." 107 | 108 | #: ../../../MainPanel.cpp:247 109 | msgid "Please wait..." 110 | msgstr "Veuillez patienter..." 111 | 112 | #: ../../../MainPanel.cpp:270 113 | #: ../../../MainPanel.cpp:289 114 | msgid "Are you sure you want to cancel the installation?" 115 | msgstr "Êtes-vous sûr de vouloir annuler l'installation?" 116 | 117 | #: ../../../MainPanel.cpp:270 118 | #: ../../../MainPanel.cpp:289 119 | msgid "Cancel" 120 | msgstr "Annuler" 121 | 122 | #: ../../../MainPanel.cpp:312 123 | msgid "Installation succeeded!" 124 | msgstr "Installation réussie!" 125 | 126 | #: ../../../MainPanel.cpp:312 127 | #: ../../../MainPanel.cpp:316 128 | msgid "Installation" 129 | msgstr "Installation" 130 | 131 | #: ../../../MainPanel.cpp:316 132 | msgid "Installation failed!" 133 | msgstr "Erreur lors de l'installation!" 134 | 135 | #: ../../../findFile.cpp:54 136 | msgid "File not Found : " 137 | msgstr "Fichier non trouvé :" 138 | 139 | #: ../../../findFile.cpp:54 140 | msgid "Error" 141 | msgstr "Erreur" 142 | 143 | #: ../../../strWxStdConv.hpp:106 144 | msgid "bytes" 145 | msgstr "octets" 146 | 147 | #: ../../../AppConfig.hpp:7 148 | msgid "WoeUSB" 149 | msgstr "WoeUSB" 150 | 151 | #: ../../../DialogAbout.hpp:68 152 | msgid "About" 153 | msgstr "À Propos" 154 | 155 | -------------------------------------------------------------------------------- /setup-development-environment.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #shellcheck disable=SC2034 3 | 4 | ## Makes debuggers' life easier - Unofficial Bash Strict Mode 5 | ## BASHDOC: Shell Builtin Commands - Modifying Shell Behavior - The Set Builtin 6 | set -o errexit 7 | set -o errtrace 8 | set -o nounset 9 | set -o pipefail 10 | 11 | for required_command in \ 12 | realpath\ 13 | basename\ 14 | dirname\ 15 | git\ 16 | rm 17 | do 18 | if ! command -v "${required_command}" >/dev/null; then 19 | printf\ 20 | "Error: This program requires \"%s\" command in your \$PATH.\n"\ 21 | "${required_command}"\ 22 | 1>&2 23 | exit 1 24 | fi 25 | done 26 | 27 | ## Non-overridable Primitive Variables 28 | ## BASHDOC: Shell Variables » Bash Variables 29 | ## BASHDOC: Basic Shell Features » Shell Parameters » Special Parameters 30 | if [ -v "BASH_SOURCE[0]" ]; then 31 | RUNTIME_EXECUTABLE_PATH="$(realpath --strip "${BASH_SOURCE[0]}")" 32 | RUNTIME_EXECUTABLE_FILENAME="$(basename "${RUNTIME_EXECUTABLE_PATH}")" 33 | RUNTIME_EXECUTABLE_NAME="${RUNTIME_EXECUTABLE_FILENAME%.*}" 34 | RUNTIME_EXECUTABLE_DIRECTORY="$(dirname "${RUNTIME_EXECUTABLE_PATH}")" 35 | RUNTIME_COMMANDLINE_BASECOMMAND="${0}" 36 | declare -r\ 37 | RUNTIME_EXECUTABLE_FILENAME\ 38 | RUNTIME_EXECUTABLE_DIRECTORY\ 39 | RUNTIME_EXECUTABLE_NAME\ 40 | RUNTIME_EXECUTABLE_PATHABSOLUTE\ 41 | RUNTIME_COMMANDLINE_BASECOMMAND 42 | fi 43 | declare -ar RUNTIME_COMMANDLINE_PARAMETERS=("${@}") 44 | 45 | ## init function: entrypoint of main program 46 | ## This function is called near the end of the file, 47 | ## with the script's command-line parameters as arguments 48 | init(){ 49 | if ! process_commandline_parameters; then 50 | printf\ 51 | "Error: %s: Invalid command-line parameters.\n"\ 52 | "${FUNCNAME[0]}"\ 53 | 1>&2 54 | print_help 55 | exit 1 56 | fi 57 | 58 | export GIT_DIR="${RUNTIME_EXECUTABLE_DIRECTORY}/.git" 59 | export GIT_WORK_TREE="${RUNTIME_EXECUTABLE_DIRECTORY}" 60 | 61 | printf "Setting Project-specific Git configuration..." 62 | git config include.path ../.gitconfig\ 63 | && printf "done\n" 64 | 65 | printf "Activating Git smudge filter...\n" 66 | # git - How do I programmatically determine if there are uncommitted changes? - Stack Overflow 67 | # https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes 68 | # DOC: git-diff-index(1) manpage: OPTIONS: --quiet, --exit-code 69 | local stash_is_needed=false 70 | if ! git diff-index --quiet HEAD --; then 71 | stash_is_needed=true 72 | fi 73 | if test "${stash_is_needed}" = 'true'; then 74 | git stash save &>/dev/null 75 | fi 76 | rm .git/index 77 | git checkout HEAD -- "$(git rev-parse --show-toplevel)" >/dev/null 78 | if test "${stash_is_needed}" = 'true'; then 79 | git stash pop &>/dev/null 80 | fi; unset stash_is_needed 81 | printf "done.\n" 82 | 83 | exit 0 84 | }; declare -fr init 85 | 86 | ## Traps: Functions that are triggered when certain condition occurred 87 | ## Shell Builtin Commands » Bourne Shell Builtins » trap 88 | trap_errexit(){ 89 | local line_number="${1}" 90 | 91 | printf\ 92 | "An error occurred at line number %s and the script is prematurely aborted\n"\ 93 | "${line_number}"\ 94 | 1>&2 95 | 96 | return 0 97 | }; declare -fr trap_errexit; trap 'trap_errexit ${LINENO}' ERR 98 | 99 | trap_exit(){ 100 | return 0 101 | }; declare -fr trap_exit; trap trap_exit EXIT 102 | 103 | trap_return(){ 104 | local returning_function="${1}" 105 | 106 | printf "DEBUG: %s: returning from %s\n" "${FUNCNAME[0]}" "${returning_function}" 1>&2 107 | }; declare -fr trap_return 108 | 109 | trap_interrupt(){ 110 | printf "Recieved SIGINT, script is interrupted.\n" 1>&2 111 | return 0 112 | }; declare -fr trap_interrupt; trap trap_interrupt INT 113 | 114 | print_help(){ 115 | printf "Currently no help messages are available for this program\n" 1>&2 116 | return 0 117 | }; declare -fr print_help; 118 | 119 | process_commandline_parameters() { 120 | if [ "${#RUNTIME_COMMANDLINE_PARAMETERS[@]}" -eq 0 ]; then 121 | return 0 122 | fi 123 | 124 | # modifyable parameters for parsing by consuming 125 | local -a parameters=("${RUNTIME_COMMANDLINE_PARAMETERS[@]}") 126 | 127 | # Normally we won't want debug traces to appear during parameter parsing, so we add this flag and defer it activation till returning(Y: Do debug) 128 | local enable_debug=N 129 | 130 | while true; do 131 | if [ "${#parameters[@]}" -eq 0 ]; then 132 | break 133 | else 134 | case "${parameters[0]}" in 135 | "--help"\ 136 | |"-h") 137 | print_help; 138 | exit 0 139 | ;; 140 | "--debug"\ 141 | |"-d") 142 | enable_debug="Y" 143 | ;; 144 | *) 145 | printf "ERROR: Unknown command-line argument \"%s\"\n" "${parameters[0]}" >&2 146 | return 1 147 | ;; 148 | esac 149 | # shift array by 1 = unset 1st then repack 150 | unset "parameters[0]" 151 | if [ "${#parameters[@]}" -ne 0 ]; then 152 | parameters=("${parameters[@]}") 153 | fi 154 | fi 155 | done 156 | 157 | if [ "${enable_debug}" = "Y" ]; then 158 | trap 'trap_return "${FUNCNAME[0]}"' RETURN 159 | set -o xtrace 160 | fi 161 | return 0 162 | }; declare -fr process_commandline_parameters; 163 | 164 | init "${@}" 165 | 166 | ## This script is based on the GNU Bash Shell Script Template project 167 | ## https://github.com/Lin-Buo-Ren/GNU-Bash-Shell-Script-Template 168 | ## and is based on the following version: 169 | declare -r META_BASED_ON_GNU_BASH_SHELL_SCRIPT_TEMPLATE_VERSION="v1.26.0-32-g317af27-dirty" 170 | ## You may rebase your script to incorporate new features and fixes from the template -------------------------------------------------------------------------------- /src/DialogAbout.cpp: -------------------------------------------------------------------------------- 1 | ///File : DialogAbout.cpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "DialogAbout.hpp" 21 | //------------------------------------------------------------------------------ 22 | 23 | DialogAbout::DialogAbout( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) 24 | { 25 | this->SetSizeHints( wxDefaultSize, wxDefaultSize ); 26 | 27 | wxBoxSizer* sizerAll = new wxBoxSizer( wxVERTICAL ); 28 | wxBoxSizer* sizerImg = new wxBoxSizer( wxHORIZONTAL ); 29 | 30 | wxString ImgFileName = findFile(_T("data/icon.png")); 31 | if(wxFileExists(ImgFileName)) 32 | { 33 | wxImage img(ImgFileName, wxBITMAP_TYPE_PNG); 34 | m_bitmapIcone = new wxStaticBitmap( this, wxID_ANY, wxBitmap(img), wxDefaultPosition, wxSize(48,48)); 35 | sizerImg->Add( m_bitmapIcone, 0, wxALL, 5 ); 36 | } 37 | 38 | wxBoxSizer* sizerTxt; 39 | sizerTxt = new wxBoxSizer( wxVERTICAL ); 40 | 41 | m_staticTextTitre = new wxStaticText( this, wxID_ANY, PROG_FULL_NAME_GETTEXT); 42 | m_staticTextTitre->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Sans"))); 43 | m_staticTextTitre->SetForegroundColour( wxColour( 0, 60, 118 ) ); 44 | sizerTxt->Add( m_staticTextTitre, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); 45 | 46 | m_staticTextVersion = new wxStaticText( this, wxID_ANY, wxString::Format(_("Version %s"), NUM_VERSION)); 47 | m_staticTextVersion->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Sans") ) ); 48 | m_staticTextVersion->SetForegroundColour( wxColour( 69, 141, 196 ) ); 49 | sizerTxt->Add( m_staticTextVersion, 0, wxLEFT, 5 ); 50 | sizerImg->Add( sizerTxt, 0, 0, 5 ); 51 | sizerAll->Add( sizerImg, 0, wxEXPAND, 5 ); 52 | 53 | m_NotebookAutorLicence = new wxNotebook( this, wxID_ANY); 54 | 55 | m_NotebookAutorLicence->AddPage(new PanelNoteBookAutors(m_NotebookAutorLicence, wxID_ANY, _T("slacka et al."), _T("data/woeusb-logo.png"), _T("github.com/slacka/WoeUSB")), _("Authors"), true); 56 | 57 | m_NotebookAutorLicence->AddPage(new PanelNoteBookAutors(m_NotebookAutorLicence, wxID_ANY, _T("Colin GILLE / Congelli501"), _T("data/c501-logo.png"), _T("www.congelli.eu")), _("Original WinUSB Developer"), false); 58 | 59 | wxString licenceStr = wxString::Format(_( 60 | "%s is free software: you can redistribute it and/or modify" 61 | "it under the terms of the GNU General Public License as published by" 62 | "the Free Software Foundation, either version 3 of the License, or" 63 | "(at your option) any later version.\n" 64 | "\n" 65 | "%s is distributed in the hope that it will be useful," 66 | "but WITHOUT ANY WARRANTY; without even the implied warranty of" 67 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" 68 | "GNU General Public License for more details.\n" 69 | "\n" 70 | "You should have received a copy of the GNU General Public License" 71 | "along with %s. If not, see ."), PROG_FULL_NAME_GETTEXT, PROG_FULL_NAME_GETTEXT, PROG_FULL_NAME_GETTEXT); 72 | 73 | wxTextCtrl *LicenceTxt = new wxTextCtrl(m_NotebookAutorLicence, wxID_ANY, licenceStr, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); 74 | 75 | m_NotebookAutorLicence->AddPage(LicenceTxt, _("License")); 76 | 77 | sizerAll->Add( m_NotebookAutorLicence, 1, wxEXPAND | wxALL, 5 ); 78 | 79 | m_BtOk = new wxButton(this, wxID_OK); 80 | sizerAll->Add( m_BtOk, 0, wxALIGN_RIGHT | wxBOTTOM | wxRIGHT, 5 ); 81 | m_BtOk->SetFocus(); 82 | 83 | this->SetSizer( sizerAll ); 84 | this->Layout(); 85 | } 86 | 87 | //------------------------------------------------------------------------------ 88 | PanelNoteBookAutors::PanelNoteBookAutors( wxWindow* parent, wxWindowID id, const wxString &autherName, const wxString &imgName, const wxString &siteLink, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) 89 | { 90 | wxBoxSizer *sizerNoteBookAutors = new wxBoxSizer( wxVERTICAL ); 91 | 92 | wxStaticText *AuteurStaticText = new wxStaticText(this, wxID_ANY, autherName); 93 | sizerNoteBookAutors->Add(AuteurStaticText, 0, wxALL, 5); 94 | 95 | if(siteLink != _T("")) 96 | { 97 | wxHyperlinkCtrl *AuteurLink = new wxHyperlinkCtrl(this, wxID_ANY, siteLink, siteLink); 98 | sizerNoteBookAutors->Add(AuteurLink, 0, wxLEFT | wxBOTTOM, 5); 99 | } 100 | 101 | if(imgName != _T("")) 102 | { 103 | wxString ImgFileName = findFile(imgName); 104 | if(wxFileExists(ImgFileName)) 105 | { 106 | wxImage img(ImgFileName, wxBITMAP_TYPE_PNG); 107 | wxStaticBitmap *ImgAutherLogo = new wxStaticBitmap( this, wxID_ANY, wxBitmap(img)); 108 | sizerNoteBookAutors->Add(ImgAutherLogo, 0, wxLEFT, 5); 109 | } 110 | } 111 | 112 | this->SetSizer(sizerNoteBookAutors); 113 | } 114 | -------------------------------------------------------------------------------- /src/strWxStdConv.hpp: -------------------------------------------------------------------------------- 1 | ///File : strWxStdConv.hpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "wx/wxprec.h" 21 | 22 | #ifdef __BORLANDC__ 23 | #pragma hdrstop 24 | #endif 25 | 26 | #ifndef WX_PRECOMP 27 | #include "wx/wx.h" 28 | #endif 29 | //------------------------------------------------------------------------------ 30 | #include "math.h" 31 | #include "config.hpp" 32 | //------------------------------------------------------------------------------ 33 | 34 | #if not defined PACKAGE 35 | #error "This program should be built with its package!"// #define PACKAGE devismaker 36 | #endif 37 | 38 | #include 39 | #include "nbStrConvert.hpp" 40 | 41 | #if not defined STR_WX_STD_CONV_HPP_WINUSBGUI 42 | #define STR_WX_STD_CONV_HPP_WINUSBGUI 43 | //------------------------------------------------------------------------------ 44 | // String 45 | std::string StrWxToStd(const wxString &str); 46 | wxString StrStdToWx(const std::string &str); 47 | wxString wxStrAutoCut(wxString str, const int &maxLen = 60); 48 | 49 | // Filename (Pour Windows) 50 | std::string filenameWxToStd(const wxString &str); 51 | wxString filenameStdToWx(const std::string &str); 52 | //------------------------------------------------------------------------------ 53 | template < typename T > 54 | bool wxStrToNb(wxString str, T *nb) // Avec verification 55 | { 56 | // 1 : Remplacement des "." par des "," 57 | int lang = wxLocale::GetSystemLanguage(); 58 | 59 | if(lang == wxLANGUAGE_FRENCH || lang == wxLANGUAGE_FRENCH_BELGIAN || lang == wxLANGUAGE_FRENCH_CANADIAN || lang == wxLANGUAGE_FRENCH_LUXEMBOURG || lang == wxLANGUAGE_FRENCH_MONACO || lang == wxLANGUAGE_FRENCH_SWISS) 60 | { 61 | // Si on est en france ==> On remplace les "." du pavé numérique par des ",". 62 | str.Replace(_T("."), _T(",")); 63 | } 64 | 65 | // On transforme en double ==> Le plus de précision. 66 | double tempNb; 67 | bool isOk = str.ToDouble(&tempNb); 68 | 69 | // On cast en "T" 70 | 71 | *nb = T(tempNb); 72 | 73 | return isOk; 74 | } 75 | //------------------------------------------------------------------------------ 76 | // Sans verif... 77 | template < typename T > 78 | T wxStrToNb(const wxString &str) 79 | { 80 | T tempNb; 81 | wxStrToNb(str, &tempNb); 82 | return tempNb; 83 | } 84 | //------------------------------------------------------------------------------ 85 | template < typename T > 86 | wxString wxNbToStr(const T &nb) 87 | { 88 | // On doit passer par les std::string pour eviter les nb scientifiques. 89 | return StrStdToWx(nbToString(nb)); 90 | } 91 | //------------------------------------------------------------------------------ 92 | template < typename T > 93 | wxString wxNbToHexaStr(const T &nb) 94 | { 95 | std::stringstream ss; 96 | std::string str; 97 | ss << std::hex << nb; 98 | 99 | return StrStdToWx(ss.str()); 100 | } 101 | //------------------------------------------------------------------------------ 102 | template < typename T > 103 | wxString ArrangeByteSize(const T &size) 104 | { 105 | // Selection de l'unité... 106 | const wxString unitList[] = {_("bytes"), _T("Kio"), _T("Mio"), _T("Gio"), _T("Tio") }; 107 | const int unityListSize = sizeof(unitList) / sizeof(wxString); 108 | int unity = 0; 109 | unsigned long unityDiv = 1; 110 | 111 | while(1) 112 | { 113 | unityDiv = pow(1024, unity); 114 | 115 | if(double(size) / double(unityDiv) < 999) 116 | { 117 | break; // Ok : bonne unité 118 | } 119 | 120 | if(unity >= unityListSize - 1) 121 | { 122 | break; 123 | } 124 | 125 | unity++; 126 | } 127 | 128 | // On remplie la wxString 129 | double nb = double(size) / double(unityDiv); 130 | wxString tempStr = wxNbToStr(nb); 131 | 132 | // Quel est le symole de la virgule ? 133 | const wxString virguleChar = _T("."); 134 | //wxString virguleChar = StrStdToWx(cfg->GetString("nb_virguleString")); 135 | //tempStr.Replace( _T("."), virguleChar); 136 | 137 | const int synifNb = 2; 138 | 139 | // On arrondi 140 | int virgulePos = tempStr.Find(virguleChar); 141 | if(virgulePos != wxNOT_FOUND && tempStr.Len() - virgulePos > synifNb + 1) // Trop de chiffres significatifs 142 | { 143 | wxChar lastNbChar = tempStr[tempStr.Find(virguleChar) + synifNb + 1]; 144 | // ==> A faire 145 | if(wxStrToNb(lastNbChar) >= 5) // Si le chiffre avant le dernier chiffre significatif est sup à 5 ==> rajout de 10 ^ -synifNb 146 | { 147 | // Utilise le nombre arrondi... 148 | tempStr = wxNbToStr(nb + pow(10, -synifNb)); 149 | tempStr.Replace( _T("."), virguleChar); 150 | } 151 | 152 | tempStr = tempStr.Mid(0, tempStr.Find(virguleChar) + synifNb + 1); 153 | } 154 | 155 | tempStr << _T(" ") << unitList[unity]; 156 | 157 | return tempStr; 158 | } 159 | //------------------------------------------------------------------------------ 160 | 161 | #endif // STR_WX_STD_CONV_HPP_WINUSBGUI 162 | -------------------------------------------------------------------------------- /src/MainPanel.cpp: -------------------------------------------------------------------------------- 1 | ///File : MainPanel.cpp 2 | //------------------------------------------------------------------------------ 3 | /* 4 | This file is part of WoeUSB. 5 | 6 | WoeUSB is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | WoeUSB is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with WoeUSB. If not, see . 18 | */ 19 | //------------------------------------------------------------------------------ 20 | #include "MainPanel.hpp" 21 | 22 | #include "MainFrame.hpp" 23 | #include "strWxStdConv.hpp" 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #include "MyException.hpp" 35 | #include "processManager.hpp" 36 | //------------------------------------------------------------------------------ 37 | using namespace std; 38 | //------------------------------------------------------------------------------ 39 | MainPanel::MainPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) 40 | { 41 | // Controls 42 | wxBoxSizer *MainSizer = new wxBoxSizer( wxVERTICAL ); 43 | 44 | // Iso / CD 45 | MainSizer->Add(new wxStaticText(this, wxID_ANY, _("Source :")), 0, wxALL, 3); 46 | 47 | // Iso 48 | m_isoChoice = new wxRadioButton(this, wxID_ANY, _("From a disk image (iso)")); 49 | MainSizer->Add(m_isoChoice, 0, wxALL, 3); 50 | 51 | wxBoxSizer *tmpSizer = new wxBoxSizer( wxHORIZONTAL ); 52 | tmpSizer->AddSpacer(20); 53 | m_isoFile = new wxFilePickerCtrl(this, wxID_ANY, _T(""), _("Please select a disk image"), _T("Iso images (*.iso)|*.iso;*.ISO|All files|*")); 54 | tmpSizer->Add(m_isoFile, 1, wxLEFT | wxRIGHT | wxBOTTOM, 3); 55 | MainSizer->Add(tmpSizer, 0, wxEXPAND, 0); 56 | 57 | // DVD 58 | MainSizer->Add(m_dvdChoice = new wxRadioButton(this, wxID_ANY, _("From a CD/DVD drive")), 0, wxALL, 3); 59 | 60 | // List 61 | tmpSizer = new wxBoxSizer( wxHORIZONTAL ); 62 | tmpSizer->AddSpacer(20); 63 | m_dvdDriveList = new wxListBox(this, wxID_ANY); 64 | tmpSizer->Add(m_dvdDriveList, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 3); 65 | MainSizer->Add(tmpSizer, 1, wxEXPAND, 0); 66 | 67 | // File system 68 | wxString rbxFs[] = { wxT("FAT"), wxT("NTFS") }; 69 | m_fsRadio = new wxRadioBox(this, wxID_ANY, _("File system"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(rbxFs), rbxFs); 70 | MainSizer->Add(m_fsRadio, 0, wxEXPAND | wxALL | wxALIGN_CENTER, 20); 71 | 72 | // Target 73 | MainSizer->AddSpacer(30); 74 | 75 | MainSizer->Add(new wxStaticText(this, wxID_ANY, _("Target device :")), 0, wxALL, 3); 76 | 77 | // List 78 | m_usbStickList = new wxListBox(this, wxID_ANY); 79 | MainSizer->Add(m_usbStickList, 1, wxEXPAND | wxALL, 3); 80 | 81 | // Buttons 82 | MainSizer->AddSpacer(30); 83 | 84 | wxBoxSizer *BtSizer = new wxBoxSizer( wxHORIZONTAL ); 85 | BtSizer->Add(m_btRefresh = new wxButton(this, wxID_REFRESH), 0, wxALL, 3); 86 | BtSizer->Add(m_btInstall = new wxButton(this, wxID_ANY, _("Install")), 0, wxALL, 3); 87 | 88 | MainSizer->Add(BtSizer, 0, wxALIGN_RIGHT, 0); 89 | 90 | // Finition 91 | SetSizer(MainSizer); 92 | 93 | /*m_popupMenu = new wxMenu; 94 | m_popupMenu->Append(m_menuItemAddManually = MenuAddItem(m_popupMenu, wxString(_("Add Manually")) + _T("\tCtrl+N"), _T("add.png"))); 95 | m_popupMenu->Append(m_menuItemAddAutodetect = MenuAddItem(m_popupMenu, wxString(_("Add with autodection")), _T("add.png")));*/ 96 | 97 | // Events 98 | m_usbStickList->Connect( wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(MainPanel::OnListOrFileModified), NULL, this); 99 | m_dvdDriveList->Connect( wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(MainPanel::OnListOrFileModified), NULL, this); 100 | m_isoFile->Connect( wxID_ANY, wxEVT_COMMAND_FILEPICKER_CHANGED, wxCommandEventHandler(MainPanel::OnListOrFileModified), NULL, this); 101 | 102 | m_btInstall->Connect( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainPanel::OnInstall), NULL, this); 103 | m_btRefresh->Connect( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainPanel::OnRefresh), NULL, this); 104 | 105 | m_isoChoice->Connect( wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(MainPanel::OnSourceOptionChanged), NULL, this); 106 | m_dvdChoice->Connect( wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(MainPanel::OnSourceOptionChanged), NULL, this); 107 | 108 | // Content 109 | RefreshListContent(); 110 | wxCommandEvent tmp; 111 | OnSourceOptionChanged(tmp); 112 | m_btInstall->Enable(IsInstallOk()); 113 | } 114 | 115 | //------------------------------------------------------------------------------ 116 | MainPanel::~MainPanel() 117 | { 118 | 119 | } 120 | //------------------------------------------------------------------------------ 121 | void MainPanel::RefreshListContent() 122 | { 123 | std::string tmp; 124 | std::string log; 125 | 126 | // USB 127 | { 128 | log = ""; 129 | m_usbStickDevList.clear(); 130 | m_usbStickList->Clear(); 131 | 132 | bool showAllChecked = static_cast(GetParent())->IsShowAllChecked(); 133 | 134 | std::stringstream command; 135 | command << "\"$(readlink -f '"; 136 | command << StrWxToStd(findFile(_T("data/listUsb"))); 137 | command << "')\" "; 138 | if(showAllChecked) 139 | { 140 | command << "all "; 141 | } 142 | command << "2>/dev/null"; 143 | 144 | PipeManager pipe(command.str()); 145 | 146 | while(! pipe.IsEof()) 147 | { 148 | tmp = pipe.GetLine(); 149 | if(tmp.empty()) 150 | { 151 | continue; 152 | } 153 | log += tmp; 154 | m_usbStickDevList.push_back(tmp); 155 | m_usbStickList->Append(StrStdToWx(pipe.GetLine())); 156 | } 157 | 158 | if(pipe.Close() != 0) 159 | { 160 | m_usbStickDevList.clear(); 161 | m_usbStickList->Clear(); 162 | 163 | MY_THROW("Can't read usb list !\n" << log); 164 | } 165 | } 166 | 167 | // DVD 168 | { 169 | log = ""; 170 | m_dvdDriveDevList.clear(); 171 | m_dvdDriveList->Clear(); 172 | 173 | PipeManager pipe(std::string("\"$(readlink -f '") + StrWxToStd(findFile(_T("data/listDvdDrive"))) + "')\" 2>/dev/null"); 174 | 175 | while(! pipe.IsEof()) 176 | { 177 | 178 | tmp = pipe.GetLine(); 179 | if(tmp.empty()) 180 | { 181 | continue; 182 | } 183 | log += tmp; 184 | m_dvdDriveDevList.push_back(tmp); 185 | m_dvdDriveList->Append(StrStdToWx(pipe.GetLine())); 186 | } 187 | 188 | if(pipe.Close() != 0) 189 | { 190 | m_dvdDriveDevList.clear(); 191 | m_dvdDriveList->Clear(); 192 | 193 | MY_THROW("Can't read dvd drive list !\n" << log); 194 | } 195 | } 196 | 197 | m_btInstall->Enable(IsInstallOk()); 198 | } 199 | //------------------------------------------------------------------------------ 200 | void MainPanel::OnSourceOptionChanged(wxCommandEvent& event) 201 | { 202 | bool isIso = m_isoChoice->GetValue(); 203 | 204 | m_isoFile->Enable(isIso); 205 | m_dvdDriveList->Enable(!isIso); 206 | 207 | m_btInstall->Enable(IsInstallOk()); 208 | } 209 | //------------------------------------------------------------------------------ 210 | bool MainPanel::IsInstallOk() const 211 | { 212 | bool isIso = m_isoChoice->GetValue(); 213 | return ((isIso && wxFileExists(m_isoFile->GetPath())) || (!isIso && m_dvdDriveList->GetSelection() != wxNOT_FOUND)) && m_usbStickList->GetSelection() != wxNOT_FOUND; 214 | } 215 | //------------------------------------------------------------------------------ 216 | void MainPanel::OnListOrFileModified(wxCommandEvent& event) 217 | { 218 | if(event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED && !event.IsSelection()) // Prevent segmentation fault : list box deselection send event when the frame is destroying an half the objects are deleted 219 | { 220 | return; 221 | } 222 | 223 | m_btInstall->Enable(IsInstallOk()); 224 | } 225 | //------------------------------------------------------------------------------ 226 | void MainPanel::OnRefresh(wxCommandEvent& event) 227 | { 228 | RefreshListContent(); 229 | } 230 | //------------------------------------------------------------------------------ 231 | void MainPanel::OnInstall(wxCommandEvent& event) 232 | { 233 | if(IsInstallOk()) 234 | { 235 | bool isIso = m_isoChoice->GetValue(); 236 | 237 | std::string device = m_usbStickDevList.at(m_usbStickList->GetSelection()); 238 | std::string iso; 239 | if(isIso) 240 | { 241 | iso = filenameWxToStd(m_isoFile->GetPath()); 242 | } 243 | else 244 | { 245 | iso = m_dvdDriveDevList.at(m_dvdDriveList->GetSelection()); 246 | } 247 | 248 | PipeManager pipe(std::string("pkexec sh -c 'woeusb --no-color --for-gui --target-filesystem " + StrWxToStd(m_fsRadio->GetString(m_fsRadio->GetSelection())) + " --device \"" + iso + "\" \"" + device + "\" 2>&1'")); 249 | 250 | wxProgressDialog *dialog = new wxProgressDialog(_("Installing..."), _("Please wait..."), 100, GetParent(), wxPD_APP_MODAL | wxPD_SMOOTH | wxPD_CAN_ABORT); 251 | 252 | wxString log; 253 | while(! pipe.IsEof()) 254 | { 255 | std::string tmp = pipe.GetLine(); 256 | if(!tmp.empty()) 257 | { 258 | // The message is progress percentages 259 | if(*(tmp.end() - 1) == '%') 260 | { 261 | long progress; 262 | if(!StrStdToWx(tmp.substr(0, tmp.size() - 1)).ToLong(&progress)) 263 | { 264 | continue; 265 | } 266 | 267 | if(progress > 99) // Maximum is 99 because 100 will stop the ProgressDialog 268 | { 269 | progress = 99; 270 | } 271 | 272 | // User clicks the close window button 273 | if(!dialog->Update(progress)) 274 | { 275 | if(wxMessageBox(_("Are you sure you want to cancel the installation?"), _("Cancel"), wxYES_NO | wxICON_QUESTION, this) == wxNO) 276 | { 277 | dialog->Resume(); 278 | } 279 | else 280 | { 281 | exit(1); 282 | } 283 | } 284 | } 285 | else 286 | { 287 | if(tmp == "pulse") 288 | { 289 | tmp = ""; 290 | } 291 | 292 | // User clicks the close window button 293 | if(!dialog->Pulse(StrStdToWx(tmp))) 294 | { 295 | if(wxMessageBox(_("Are you sure you want to cancel the installation?"), _("Cancel"), wxYES_NO | wxICON_QUESTION, this) == wxNO) 296 | { 297 | dialog->Resume(); 298 | } 299 | else 300 | { 301 | exit(1); 302 | } 303 | } 304 | 305 | if(!tmp.empty()) 306 | { 307 | log << StrStdToWx(tmp + "\n"); 308 | } 309 | } 310 | } 311 | } 312 | 313 | dialog->Destroy(); 314 | 315 | int exitCode = pipe.Close(); 316 | if(exitCode == 0) 317 | { 318 | wxMessageBox(_("Installation succeeded!"), _("Installation"), wxOK | wxICON_INFORMATION, this); 319 | } 320 | else 321 | { 322 | wxMessageBox(wxString(_("Installation failed!")) + _T("\nExit code: ") + wxNbToStr(exitCode) + _T("\nLog:\n") + log, _("Installation"), wxOK | wxICON_ERROR, this); 323 | } 324 | } 325 | } 326 | //------------------------------------------------------------------------------ 327 | void MainPanel::OnShowAllDrive(wxCommandEvent& event) 328 | { 329 | RefreshListContent(); 330 | } 331 | //------------------------------------------------------------------------------ 332 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl --------------------------------------------------------------------------- 2 | dnl MY_FIND_SFML() 3 | dnl Find SFML lib 4 | dnl --------------------------------------------------------------------------- 5 | 6 | AC_DEFUN([MY_FIND_SFML], 7 | [ 8 | dnl OpenGL header 9 | AM_CHECK_LIB_HEADER([GL], [gl], [GL/gl.h], [], [], AC_MSG_ERROR([ /!\ This programme requires OpenGL headers !])) 10 | 11 | dnl SFML 12 | if test "$IS_MAC" = 'true'; then 13 | CHECK_FRAMEWORK_LIST([SFML], [SFML sfml-graphics sfml-window sfml-system sfml-audio]) 14 | else 15 | AM_CHECK_LIB_HEADER([SFML], [sfml], [SFML/Graphics.hpp SFML/Window.hpp SFML/Audio.hpp SFML/System.hpp], [sfml-graphics sfml-window sfml-system sfml-audio], [], AC_MSG_ERROR([ /!\ This programme requires SFML !])) 16 | fi 17 | ]) 18 | 19 | dnl --------------------------------------------------------------------------- 20 | dnl MY_FIND_LIBNOTIFY() 21 | dnl Find LIBNOTIFY lib 22 | dnl --------------------------------------------------------------------------- 23 | 24 | AC_DEFUN([MY_FIND_LIBNOTIFY], 25 | [ 26 | dnl Pkg Config (cf man pkg-config => AUTOCONF MACROS) 27 | PKG_PROG_PKG_CONFIG dnl Check is 'pkg-config' is installed 28 | AH_TEMPLATE([USE_LIBNOTIFY], [Define if libnotify can be used.]) 29 | AH_TEMPLATE([USE_LIBNOTIFY_NEW], [Define if libnotify version is more than 0.7.3 because Gnome decided to change the API.]) 30 | 31 | if test "$IS_MINGW" = 'true'; then 32 | AC_DEFINE([USE_LIBNOTIFY], [0]) 33 | else 34 | PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4], AC_DEFINE([USE_LIBNOTIFY], [1]), AC_DEFINE([USE_LIBNOTIFY], [0])) 35 | 36 | PKG_CHECK_MODULES([LIBNOTIFY_NEW], [libnotify >= 0.7.3], AC_DEFINE([USE_LIBNOTIFY_NEW], [1]), AC_DEFINE([USE_LIBNOTIFY_NEW], [0])) 37 | 38 | LIBS_ALL="$LIBS_ALL ${LIBNOTIFY_LIBS}" 39 | AC_SUBST([LIBS_ALL], [$LIBS_ALL]) 40 | CFLAGS_ALL="$CFLAGS_ALL ${LIBNOTIFY_CFLAGS}" 41 | AC_SUBST([CFLAGS_ALL], [$CFLAGS_ALL]) 42 | fi 43 | ]) 44 | 45 | dnl --------------------------------------------------------------------------- 46 | dnl MY_FIND_WXWIDGETS() 47 | dnl Find WXWIDGETS lib 48 | dnl --------------------------------------------------------------------------- 49 | 50 | AC_DEFUN([MY_FIND_WXWIDGETS], 51 | [ 52 | AM_OPTIONS_WXCONFIG 53 | AM_PATH_WXCONFIG(2.8.4, wxWin=1, , [xrc,std]) 54 | if test "$wxWin" != 1; then 55 | AC_MSG_ERROR([ 56 | wxWidgets must be installed on your system. 57 | 58 | Please check that wx-config is in path, the directory 59 | where wxWidgets libraries are installed (returned by 60 | 'wx-config --libs' or 'wx-config --static --libs' command) 61 | is in LD_LIBRARY_PATH or equivalent variable and 62 | wxWidgets version is 2.8.4 or above. 63 | ]) 64 | fi 65 | 66 | dnl All lib options 67 | LIBS_ALL="$LIBS_ALL ${WX_LIBS}" 68 | AC_SUBST([LIBS_ALL], [$LIBS_ALL]) 69 | CFLAGS_ALL="$CFLAGS_ALL ${WX_CXXFLAGS}" 70 | AC_SUBST([CFLAGS_ALL], [$CFLAGS_ALL]) 71 | 72 | if test "$IS_MINGW" = 'true'; then 73 | EXTRA_WINDRES_ARG="$EXTRA_WINDRES_ARG $(echo "$WX_CXXFLAGS" | cut -d " " -f 1-2)" ## Pour n'avoir que les deux premiers chanps (inclue).' 74 | AC_SUBST([EXTRA_WINDRES_ARG]) 75 | fi 76 | ]) 77 | 78 | dnl --------------------------------------------------------------------------- 79 | dnl MY_FIND_BOOST() 80 | dnl Find BOOST lib 81 | dnl --------------------------------------------------------------------------- 82 | 83 | AC_DEFUN([MY_FIND_BOOST], 84 | [ 85 | dnl Boost 86 | AM_CHECK_LIB_HEADER([BOOST], [boost], [boost/config.hpp], [], [], AC_MSG_ERROR([ /!\ This programme requires boost !])) 87 | ]) 88 | 89 | dnl --------------------------------------------------------------------------- 90 | dnl MY_FIND_GTK2() 91 | dnl Find BOOST lib 92 | dnl --------------------------------------------------------------------------- 93 | 94 | AC_DEFUN([MY_FIND_GTK2], 95 | [ 96 | dnl gtk+2 97 | if test "$IS_MINGW" = 'false'; then 98 | AM_CHECK_LIB_HEADER([GTK2], [gtk+-2.0], [gdk/gdkx.h gtk/gtk.h], [gtk-x11-2.0], [], AC_MSG_ERROR([ /!\ This programme requires gtk+ 2 !])) 99 | fi 100 | ]) 101 | 102 | dnl --------------------------------------------------------------------------- 103 | dnl MY_FIND_LUA() 104 | dnl Find LUA lib 105 | dnl --------------------------------------------------------------------------- 106 | 107 | AC_DEFUN([MY_FIND_LUA], 108 | [ 109 | dnl LUA 110 | LUA_VERSION="5.1" dnl Sous windows, la lib s'appelle lua, et pas lua5.1, Sous Ubunut, la lib s'appelle lua ! 111 | AM_CHECK_LIB_HEADER([LUA], [lua${LUA_VERSION}], [lua.hpp], [lua @ lua${LUA_VERSION}], [], [AC_MSG_ERROR([ /!\ This programme requires LUA !])]) 112 | ]) 113 | 114 | dnl --------------------------------------------------------------------------- 115 | dnl MY_FIND_OPENGL() 116 | dnl Find OPENGL lib 117 | dnl --------------------------------------------------------------------------- 118 | 119 | AC_DEFUN([MY_FIND_OPENGL], 120 | [ 121 | dnl OpenGL header 122 | AM_CHECK_LIB_HEADER([GL], [gl], [GL/gl.h], [], [], AC_MSG_ERROR([ /!\ This programme requires OpenGL headers !])) 123 | 124 | dnl OpenGL WIN32 & MAC 125 | if test "$IS_MINGW" = 'true'; then 126 | dnl intl (gettext) 127 | AM_CHECK_LIB_HEADER([OGLWIN], [], [], [opengl32 glu32], [], [AC_MSG_ERROR([ /!\ This programme requires intl (gettext) !])]) 128 | elif test "$IS_MAC" = 'true'; then 129 | CHECK_FRAMEWORK_LIST([SFML], [OpenGL GLUT]) 130 | fi 131 | ]) 132 | 133 | dnl --------------------------------------------------------------------------- 134 | dnl MY_FIND_INTL() 135 | dnl Find INTL lib 136 | dnl --------------------------------------------------------------------------- 137 | 138 | AC_DEFUN([MY_FIND_INTL], 139 | [ 140 | dnl intl (gettext) 141 | if test "$IS_LINUX" = 'false'; then 142 | AM_CHECK_LIB_HEADER([INTL], [intl], [libintl.h locale.h], [intl], [], [AC_MSG_ERROR([ /!\ This programme requires intl (gettext) !])]) 143 | fi 144 | ]) 145 | 146 | dnl --------------------------------------------------------------------------- 147 | dnl MY_FIND_STDCPP() 148 | dnl Find stdc++ lib 149 | dnl --------------------------------------------------------------------------- 150 | 151 | AC_DEFUN([MY_FIND_STDCPP], 152 | [ 153 | dnl STL, pas sous windows comme on passe en stdc++ static 154 | if test "$IS_MINGW" = 'false'; then 155 | AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR([ /!\ This programme requires libstdc++ !])) 156 | fi 157 | ]) 158 | 159 | dnl --------------------------------------------------------------------------- 160 | dnl MY_PACKAGE_INIT(package full name) 161 | dnl 162 | dnl Init the source package 163 | dnl 164 | dnl --------------------------------------------------------------------------- 165 | 166 | AC_DEFUN([MY_PACKAGE_INIT], 167 | [ 168 | AM_CONFIG_HEADER(src/config.hpp) 169 | 170 | AC_SUBST(VERSION) 171 | 172 | ISODATE=`date +%Y-%m-%d` 173 | AC_SUBST([ISODATE]) 174 | PACKAGE_NAME="$1" 175 | AC_SUBST([PACKAGE_NAME]) 176 | AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"]) 177 | ]) 178 | 179 | dnl --------------------------------------------------------------------------- 180 | dnl MY_INIT_CPP_PROGS() 181 | dnl 182 | dnl Init programs for C++ sources 183 | dnl 184 | dnl --------------------------------------------------------------------------- 185 | 186 | dnl AC_DEFUN([MY_INIT_CPP_PROGS], 187 | dnl [ 188 | dnl dnl Checks for programs. 189 | dnl AC_PROG_INSTALL 190 | dnl #AC_PROG_CC 191 | dnl AC_PROG_CXX 192 | dnl AC_PROG_CPP 193 | dnl AC_PROG_LN_S 194 | dnl ]) 195 | 196 | dnl --------------------------------------------------------------------------- 197 | dnl MY_ECHO_BUILD_INFO() 198 | dnl 199 | dnl Init programs for C++ sources 200 | dnl 201 | dnl --------------------------------------------------------------------------- 202 | 203 | AC_DEFUN([MY_ECHO_BUILD_INFO], 204 | [ 205 | # Autre 206 | INFO_LINE="####################################" 207 | 208 | # Recap 209 | MSG="The package is now configured. You should type make !" 210 | 211 | MSG="$MSG\n DEBUG MODE : " 212 | if test "$DEBUG" = 1; then 213 | debugModeStr="enable" 214 | else 215 | debugModeStr="disable" 216 | fi 217 | MSG="${MSG}${debugModeStr}." 218 | 219 | 220 | MSG="$MSG\n TARGET PLATFORM : " 221 | MSG="${MSG}${MY_TARGET_OS}." 222 | MSG="$MSG\n INSTALLATION PREFIX : " 223 | MSG="${MSG}${prefix}." 224 | 225 | echo -e "\n${INFO_LINE}\n\n${MSG}\n\n${INFO_LINE}\n" 226 | ]) 227 | 228 | dnl --------------------------------------------------------------------------- 229 | dnl MY_INIT_LIBTOOL 230 | dnl 231 | dnl Init libtool 232 | dnl 233 | dnl --------------------------------------------------------------------------- 234 | 235 | dnl AC_DEFUN([MY_INIT_LIBTOOL], 236 | dnl [ 237 | dnl dnl To compile libs 238 | dnl AM_PROG_LIBTOOL dnl indique que l'on utilise Libtool pour la compilation 239 | dnl AC_PROG_MAKE_SET dnl indique que l'on doit disposer de make qui est utilisé par Libtool 240 | dnl ]) 241 | 242 | dnl --------------------------------------------------------------------------- 243 | dnl MY_INIT_DEBUG_SWITCH([Force debug]) 244 | dnl 245 | dnl Allow the user tu build the program in debug mode ; doesn't edit any cpp options ! 246 | dnl 247 | dnl --------------------------------------------------------------------------- 248 | 249 | AC_DEFUN([MY_INIT_DEBUG_SWITCH], 250 | [ 251 | dnl debug 252 | DEBUG=0 253 | AC_ARG_ENABLE([debug], [ --enable-debug Chose if the package should be built in debug mode], [DEBUG=1]) 254 | 255 | dnl Force debug 256 | if test "$1" = "true" || test "$1" = "1"; then 257 | DEBUG=1 258 | fi 259 | 260 | AC_MSG_CHECKING([if debug is enabled]) 261 | 262 | AH_TEMPLATE([DEBUG], [Define is a debug version sould be build]) 263 | AM_CONDITIONAL([IS_DEBUG], [test "$DEBUG" -eq 1]) 264 | AC_DEFINE_UNQUOTED([DEBUG], [$DEBUG]) 265 | 266 | if test "$DEBUG" -eq 1; then 267 | AC_MSG_RESULT([yes]) 268 | else 269 | AC_MSG_RESULT([no]) 270 | fi 271 | ]) 272 | 273 | dnl --------------------------------------------------------------------------- 274 | dnl MY_INIT_BUILD_OPTION(Debug option, no debug option) 275 | dnl 276 | dnl Init CXXFLAGS and CPPFLAGS 277 | dnl 278 | dnl --------------------------------------------------------------------------- 279 | 280 | AC_DEFUN([MY_INIT_BUILD_OPTION], 281 | [ 282 | dnl Basic 283 | warningOptions=' -Wall -Wclobbered -Wempty-body -Wmissing-field-initializers -Wsign-compare -Wtype-limits -Wuninitialized' # -Wignored-qualifiers 284 | if test "$IS_MAC" = 'true'; then 285 | warningOptions=' -Wall' 286 | fi 287 | 288 | if test "$DEBUG" -eq 1; then 289 | CXXFLAGS="$1 $warningOptions" 290 | else 291 | CXXFLAGS="$2 $warningOptions" 292 | fi 293 | 294 | CPPFLAGS=${CXXFLAGS} 295 | AC_SUBST([CXXFLAGS]) 296 | AC_SUBST([CPPFLAGS]) 297 | 298 | dnl Extra LDFLAGS (for win32) 299 | EXTRA_LDFLAGS='' 300 | 301 | if test "$IS_MINGW" = "true"; then 302 | true 303 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -static-libgcc -static-libstdc++" dnl Static stdc++ 304 | 305 | if test "$DEBUG" -eq 0; then 306 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -mwindows" 307 | dnl -mwindows : Pour cacher la console sous windows. 308 | fi 309 | fi 310 | 311 | AC_SUBST([EXTRA_LDFLAGS]) 312 | 313 | dnl EXTRA_WINDRES_ARG 314 | EXTRA_WINDRES_ARG="$EXTRA_WINDRES_ARG" 315 | AC_SUBST([EXTRA_WINDRES_ARG]) 316 | ]) 317 | 318 | dnl --------------------------------------------------------------------------- 319 | dnl MY_INIT_DATA_PATH 320 | dnl 321 | dnl Define data path for unix / win32 depending on the current target system 322 | dnl 323 | dnl --------------------------------------------------------------------------- 324 | 325 | AC_DEFUN([MY_INIT_DATA_PATH], 326 | [ 327 | if test "$IS_MINGW" = true; then 328 | mypkgdatadir="$prefix" 329 | bindir="$prefix" 330 | AC_SUBST([mypkgdatadir]) 331 | AC_SUBST([prefix]) 332 | else 333 | mypkgdatadir="$datadir/$PACKAGE" 334 | AC_SUBST([mypkgdatadir]) 335 | fi 336 | ]) 337 | 338 | dnl --------------------------------------------------------------------------- 339 | dnl AM_CHECK_LIB_HEADER(LIBNAME-MAJ, NAME, HEADERS, LIBS, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 340 | dnl 341 | dnl My lib & header check 342 | dnl 343 | dnl Example use: 344 | dnl AM_CHECK_LIB_HEADER([LUA], [lua], [lua.hpp], [lua5.1], [], [Error]) 345 | dnl --------------------------------------------------------------------------- 346 | 347 | AC_DEFUN([AM_CHECK_LIB_HEADER], 348 | [ 349 | declare $1_CFLAGS='' 350 | declare $1_LIBS='' 351 | 352 | dnl Headers 353 | dnl We try with check-headers 354 | headerOk=1 355 | for headerName in $3; do 356 | AC_CHECK_HEADERS([$headerName],[],[headerOk=0]) 357 | done 358 | 359 | dnl Libs 360 | backLibs="$LIBS" 361 | 362 | libsOk=1 363 | libsList='' 364 | 365 | isLastField=0 366 | fieldId=1 367 | while test "$isLastField" -eq 0; do 368 | toTestLibsList='' 369 | 370 | if ! echo "$4" | grep '@' > '/dev/null'; then 371 | dnl Only on field 372 | isLastField=1 373 | toTestLibsList="$4" 374 | else 375 | toTestLibsList="$(echo $4 | cut -d'@' -f$fieldId)" 376 | fi 377 | 378 | if test -n "$toTestLibsList"; then 379 | libsList='' 380 | libsOk=1 381 | 382 | for libName in $toTestLibsList; do 383 | AC_CHECK_LIB([$libName], [main], [], [libsOk=0]) 384 | libsList="$libsList -l$libName" 385 | done 386 | else 387 | isLastField=1 dnl Fin 388 | libsList='' 389 | 390 | if test -n "$4"; then 391 | dnl Liste se finie par "|" => pas ok ! 392 | libsOk=0 393 | else 394 | dnl Liste vide => ok ! 395 | libsOk=1 396 | fi 397 | fi 398 | 399 | if test "$libsOk" -eq 1; then 400 | dnl On a trouvé une liste qui marche => on arrète ! 401 | isLastField=1 402 | fi 403 | 404 | let fieldId=fieldId+1 405 | done 406 | 407 | AC_SUBST([LIBS], [$backLibs]) 408 | 409 | dnl pkg-config 410 | if test "$headerOk" -eq 0 || test "$libsOk" -eq 0; then 411 | if test -n "$2"; then 412 | dnl We try with pkg-config 413 | PKG_PROG_PKG_CONFIG 414 | PKG_CHECK_MODULES([$1], [$2], [headerOk=1; libsOk=1], []) 415 | 416 | if test "$headerOk" -eq 0 || test "$libsOk" -eq 0; then 417 | dnl Still not found 418 | $6 419 | true # We need a command if $6 is empty 420 | else 421 | dnl All si Ok 422 | $5 423 | true # We need a command if $5 is empty 424 | fi 425 | else 426 | dnl Not found 427 | $6 428 | true # We need a command if $6 is empty 429 | fi 430 | else 431 | dnl All is Ok 432 | AC_SUBST([$1_LIBS], [$libsList]) 433 | AC_SUBST([$1_CFLAGS], ['']) 434 | $5 435 | fi 436 | 437 | dnl All lib options 438 | LIBS_ALL="$LIBS_ALL ${$1_LIBS}" 439 | AC_SUBST([LIBS_ALL], [$LIBS_ALL]) 440 | CFLAGS_ALL="$CFLAGS_ALL ${$1_CFLAGS}" 441 | AC_SUBST([CFLAGS_ALL], [$CFLAGS_ALL]) 442 | ]) 443 | 444 | dnl --------------------------------------------------------------------------- 445 | dnl CHECK_FRAMEWORK_LIST(libNameMaj, framework list) 446 | dnl 447 | dnl Check for windows ressources compiler (windres) 448 | dnl 449 | dnl Example use: 450 | dnl CHECK_FRAMEWORK_LIST([SFML], [SFML sfml-graphics sfml-window sfml-system sfml-audio]) 451 | dnl --------------------------------------------------------------------------- 452 | 453 | AC_DEFUN([CHECK_FRAMEWORK_LIST], 454 | [ 455 | frameworkPathList="/System/Library/Frameworks /Library/Frameworks" 456 | 457 | declare $1_CFLAGS='' 458 | declare $1_LIBS='' 459 | 460 | frameworksOk=1 461 | frameworksList='' 462 | 463 | isLastField=0 464 | fieldId=1 465 | while test "$isLastField" -eq 0; do 466 | toTestframeworksList='' 467 | 468 | if ! echo "$2" | grep '@' > '/dev/null'; then 469 | dnl Only on field 470 | isLastField=1 471 | toTestframeworksList="$2" 472 | else 473 | toTestframeworksList="$(echo $2 | cut -d'@' -f$fieldId)" 474 | fi 475 | 476 | if test -n "$toTestframeworksList"; then 477 | frameworksList='' 478 | frameworksOk=1 479 | 480 | for frameworkName in $toTestframeworksList; do 481 | AC_MSG_CHECKING([for framework $frameworkName]) 482 | isThisFrameworkOk=0 483 | 484 | for frameworkPath in $frameworkPathList; do 485 | dir="$frameworkPath/$frameworkName.framework/Versions/Current" 486 | if test -d "$dir"; then 487 | isThisFrameworkOk=1 488 | 489 | frameworksList="$frameworksList -framework $frameworkName" 490 | 491 | AC_MSG_RESULT([yes : $dir]) 492 | break 493 | fi 494 | done 495 | 496 | AC_MSG_RESULT([no]) 497 | done 498 | else 499 | isLastField=1 dnl Fin 500 | frameworksList='' 501 | 502 | if test -n "$2"; then 503 | dnl Liste se finie par "|" => pas ok ! 504 | frameworksOk=0 505 | else 506 | dnl Liste vide => ok ! 507 | frameworksOk=1 508 | fi 509 | fi 510 | 511 | if test "$frameworksOk" -eq 1; then 512 | dnl On a trouvé une liste qui marche => on arrète ! 513 | isLastField=1 514 | fi 515 | 516 | let fieldId=fieldId+1 517 | done 518 | 519 | dnl Save 520 | if test "$frameworksOk" -eq 1; then 521 | AC_SUBST([$1_LIBS], [$frameworksList]) 522 | AC_SUBST([$1_CFLAGS], [$frameworksList]) 523 | 524 | dnl All lib options 525 | LIBS_ALL="$LIBS_ALL ${$1_LIBS}" 526 | AC_SUBST([LIBS_ALL], [$LIBS_ALL]) 527 | CFLAGS_ALL="$CFLAGS_ALL ${$1_CFLAGS}" 528 | AC_SUBST([CFLAGS_ALL], [$CFLAGS_ALL]) 529 | else 530 | AC_MSG_ERROR([ /!\ This programme requires the folowing frameworks : $2 !]) 531 | fi 532 | ]) 533 | 534 | 535 | dnl --------------------------------------------------------------------------- 536 | dnl AM_FIND_WINDRES() 537 | dnl 538 | dnl Check for windows ressources compiler (windres) 539 | dnl 540 | dnl Example use: 541 | dnl AM_FIND_WINDRES() 542 | dnl --------------------------------------------------------------------------- 543 | 544 | AC_DEFUN([AM_FIND_WINDRES], 545 | [ 546 | WINDRES='' 547 | 548 | if test "$IS_MINGW" = 'true'; then 549 | AC_MSG_CHECKING([for windres]) 550 | for name in 'windres' 'i586-pc-mingw32msvc'; do 551 | if which "$name" > /dev/null; then 552 | WINDRES="$name" 553 | AM_CONDITIONAL([IS_MINGW], [true]) 554 | AC_MSG_RESULT(["yes : $WINDRES"]) 555 | break 556 | fi 557 | done 558 | 559 | if test -z "$WINDRES"; then 560 | AC_MSG_RESULT(["no"]) 561 | fi 562 | fi 563 | 564 | AM_CONDITIONAL([HAVE_WINDRES], [test -n "$WINDRES"]) 565 | AC_SUBST([WINDRES]) 566 | ]) 567 | 568 | dnl --------------------------------------------------------------------------- 569 | dnl MY_DETECT_OS() 570 | dnl 571 | dnl Check for the target operation system 572 | dnl 573 | dnl Set: IS_MINGW (true or false) 574 | dnl Set: IS_LINUX (true or false) 575 | dnl Set: IS_MAC (true or false) 576 | dnl Set: MY_TARGET_OS (mingw, linux or mac) 577 | dnl Example use: 578 | dnl AM_FIND_WINDRES() 579 | dnl --------------------------------------------------------------------------- 580 | 581 | AC_DEFUN([MY_DETECT_OS], 582 | [ 583 | if echo $host | grep "linux" > /dev/null; then 584 | MY_TARGET_OS="linux" 585 | IS_MINGW="false" 586 | IS_LINUX="true" 587 | IS_MAC="false" 588 | elif echo $host | grep "mingw" > /dev/null; then 589 | MY_TARGET_OS="mingw" 590 | IS_MINGW="true" 591 | IS_LINUX="false" 592 | IS_MAC="false" 593 | elif echo $host | grep "darwin" > /dev/null; then 594 | MY_TARGET_OS="darwin" 595 | IS_MINGW="false" 596 | IS_LINUX="false" 597 | IS_MAC="true" 598 | else 599 | MY_TARGET_OS="unknown" 600 | IS_MINGW="false" 601 | IS_LINUX="false" 602 | IS_MAC="false" 603 | 604 | AC_MSG_ERROR([ /!\ Unknown OS !]) 605 | fi 606 | 607 | AC_SUBST([MY_TARGET_OS]) 608 | AM_CONDITIONAL([IS_MINGW], [$IS_MINGW]) 609 | AM_CONDITIONAL([IS_LINUX], [$IS_LINUX]) 610 | AM_CONDITIONAL([IS_MAC], [$IS_MAC]) 611 | ]) 612 | 613 | dnl --------------------------------------------------------------------------- 614 | dnl Macros for wxWidgets detection. Typically used in configure.in as: 615 | dnl 616 | dnl AC_ARG_ENABLE(...) 617 | dnl AC_ARG_WITH(...) 618 | dnl ... 619 | dnl AM_OPTIONS_WXCONFIG 620 | dnl ... 621 | dnl ... 622 | dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1) 623 | dnl if test "$wxWin" != 1; then 624 | dnl AC_MSG_ERROR([ 625 | dnl wxWidgets must be installed on your system 626 | dnl but wx-config script couldn't be found. 627 | dnl 628 | dnl Please check that wx-config is in path, the directory 629 | dnl where wxWidgets libraries are installed (returned by 630 | dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or 631 | dnl equivalent variable and wxWidgets version is 2.3.4 or above. 632 | dnl ]) 633 | dnl fi 634 | dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" 635 | dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" 636 | dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" 637 | dnl 638 | dnl LIBS="$LIBS $WX_LIBS" 639 | dnl --------------------------------------------------------------------------- 640 | 641 | dnl --------------------------------------------------------------------------- 642 | dnl AM_OPTIONS_WXCONFIG 643 | dnl 644 | dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and 645 | dnl --wx-config command line options 646 | dnl --------------------------------------------------------------------------- 647 | 648 | AC_DEFUN([AM_OPTIONS_WXCONFIG], 649 | [ 650 | AC_ARG_WITH(wxdir, 651 | [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], 652 | [ wx_config_name="$withval/wx-config" 653 | wx_config_args="--inplace"]) 654 | AC_ARG_WITH(wx-config, 655 | [ --with-wx-config=CONFIG wx-config script to use (optional)], 656 | wx_config_name="$withval" ) 657 | AC_ARG_WITH(wx-prefix, 658 | [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)], 659 | wx_config_prefix="$withval", wx_config_prefix="") 660 | AC_ARG_WITH(wx-exec-prefix, 661 | [ --with-wx-exec-prefix=PREFIX 662 | Exec prefix where wxWidgets is installed (optional)], 663 | wx_config_exec_prefix="$withval", wx_config_exec_prefix="") 664 | ]) 665 | 666 | dnl Helper macro for checking if wx version is at least $1.$2.$3, set's 667 | dnl wx_ver_ok=yes if it is: 668 | AC_DEFUN([_WX_PRIVATE_CHECK_VERSION], 669 | [ 670 | wx_ver_ok="" 671 | if test "x$WX_VERSION" != x ; then 672 | if test $wx_config_major_version -gt $1; then 673 | wx_ver_ok=yes 674 | else 675 | if test $wx_config_major_version -eq $1; then 676 | if test $wx_config_minor_version -gt $2; then 677 | wx_ver_ok=yes 678 | else 679 | if test $wx_config_minor_version -eq $2; then 680 | if test $wx_config_micro_version -ge $3; then 681 | wx_ver_ok=yes 682 | fi 683 | fi 684 | fi 685 | fi 686 | fi 687 | fi 688 | ]) 689 | 690 | dnl --------------------------------------------------------------------------- 691 | dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND 692 | dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) 693 | dnl 694 | dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC 695 | dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME 696 | dnl environment variable to override the default name of the wx-config script 697 | dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this 698 | dnl case the macro won't even waste time on tests for its existence. 699 | dnl 700 | dnl Optional WX-LIBS argument contains comma- or space-separated list of 701 | dnl wxWidgets libraries to link against (it may include contrib libraries). If 702 | dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to 703 | dnl link with all of the core wxWidgets libraries. 704 | dnl 705 | dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config 706 | dnl invocation command in present. It can be used to fine-tune lookup of 707 | dnl best wxWidgets build available. 708 | dnl 709 | dnl Example use: 710 | dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] 711 | dnl [--unicode --debug]) 712 | dnl --------------------------------------------------------------------------- 713 | 714 | dnl 715 | dnl Get the cflags and libraries from the wx-config script 716 | dnl 717 | AC_DEFUN([AM_PATH_WXCONFIG], 718 | [ 719 | dnl do we have wx-config name: it can be wx-config or wxd-config or ... 720 | if test x${WX_CONFIG_NAME+set} != xset ; then 721 | WX_CONFIG_NAME=wx-config 722 | fi 723 | 724 | if test "x$wx_config_name" != x ; then 725 | WX_CONFIG_NAME="$wx_config_name" 726 | fi 727 | 728 | dnl deal with optional prefixes 729 | if test x$wx_config_exec_prefix != x ; then 730 | wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" 731 | WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" 732 | fi 733 | if test x$wx_config_prefix != x ; then 734 | wx_config_args="$wx_config_args --prefix=$wx_config_prefix" 735 | WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" 736 | fi 737 | if test "$cross_compiling" = "yes"; then 738 | wx_config_args="$wx_config_args --host=$host_alias" 739 | fi 740 | 741 | dnl don't search the PATH if WX_CONFIG_NAME is absolute filename 742 | if test -x "$WX_CONFIG_NAME" ; then 743 | AC_MSG_CHECKING(for wx-config) 744 | WX_CONFIG_PATH="$WX_CONFIG_NAME" 745 | AC_MSG_RESULT($WX_CONFIG_PATH) 746 | else 747 | AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH") 748 | fi 749 | 750 | if test "$WX_CONFIG_PATH" != "no" ; then 751 | WX_VERSION="" 752 | 753 | min_wx_version=ifelse([$1], ,2.2.1,$1) 754 | if test -z "$5" ; then 755 | AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version]) 756 | else 757 | AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) 758 | fi 759 | 760 | WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4" 761 | 762 | WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` 763 | wx_config_major_version=`echo $WX_VERSION | \ 764 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 765 | wx_config_minor_version=`echo $WX_VERSION | \ 766 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 767 | wx_config_micro_version=`echo $WX_VERSION | \ 768 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 769 | 770 | wx_requested_major_version=`echo $min_wx_version | \ 771 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 772 | wx_requested_minor_version=`echo $min_wx_version | \ 773 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 774 | wx_requested_micro_version=`echo $min_wx_version | \ 775 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 776 | 777 | _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version], 778 | [$wx_requested_minor_version], 779 | [$wx_requested_micro_version]) 780 | 781 | if test -n "$wx_ver_ok"; then 782 | 783 | AC_MSG_RESULT(yes (version $WX_VERSION)) 784 | WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs` 785 | 786 | dnl is this even still appropriate? --static is a real option now 787 | dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is 788 | dnl what the user actually wants, making this redundant at best. 789 | dnl For now keep it in case anyone actually used it in the past. 790 | AC_MSG_CHECKING([for wxWidgets static library]) 791 | WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null` 792 | if test "x$WX_LIBS_STATIC" = "x"; then 793 | AC_MSG_RESULT(no) 794 | else 795 | AC_MSG_RESULT(yes) 796 | fi 797 | 798 | dnl starting with version 2.2.6 wx-config has --cppflags argument 799 | wx_has_cppflags="" 800 | if test $wx_config_major_version -gt 2; then 801 | wx_has_cppflags=yes 802 | else 803 | if test $wx_config_major_version -eq 2; then 804 | if test $wx_config_minor_version -gt 2; then 805 | wx_has_cppflags=yes 806 | else 807 | if test $wx_config_minor_version -eq 2; then 808 | if test $wx_config_micro_version -ge 6; then 809 | wx_has_cppflags=yes 810 | fi 811 | fi 812 | fi 813 | fi 814 | fi 815 | 816 | dnl starting with version 2.7.0 wx-config has --rescomp option 817 | wx_has_rescomp="" 818 | if test $wx_config_major_version -gt 2; then 819 | wx_has_rescomp=yes 820 | else 821 | if test $wx_config_major_version -eq 2; then 822 | if test $wx_config_minor_version -ge 7; then 823 | wx_has_rescomp=yes 824 | fi 825 | fi 826 | fi 827 | if test "x$wx_has_rescomp" = x ; then 828 | dnl cannot give any useful info for resource compiler 829 | WX_RESCOMP= 830 | else 831 | WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` 832 | fi 833 | 834 | if test "x$wx_has_cppflags" = x ; then 835 | dnl no choice but to define all flags like CFLAGS 836 | WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags` 837 | WX_CPPFLAGS=$WX_CFLAGS 838 | WX_CXXFLAGS=$WX_CFLAGS 839 | 840 | WX_CFLAGS_ONLY=$WX_CFLAGS 841 | WX_CXXFLAGS_ONLY=$WX_CFLAGS 842 | else 843 | dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS 844 | WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags` 845 | WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags` 846 | WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags` 847 | 848 | WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` 849 | WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` 850 | fi 851 | 852 | ifelse([$2], , :, [$2]) 853 | 854 | else 855 | 856 | if test "x$WX_VERSION" = x; then 857 | dnl no wx-config at all 858 | AC_MSG_RESULT(no) 859 | else 860 | AC_MSG_RESULT(no (version $WX_VERSION is not new enough)) 861 | fi 862 | 863 | WX_CFLAGS="" 864 | WX_CPPFLAGS="" 865 | WX_CXXFLAGS="" 866 | WX_LIBS="" 867 | WX_LIBS_STATIC="" 868 | WX_RESCOMP="" 869 | ifelse([$3], , :, [$3]) 870 | 871 | fi 872 | else 873 | 874 | WX_CFLAGS="" 875 | WX_CPPFLAGS="" 876 | WX_CXXFLAGS="" 877 | WX_LIBS="" 878 | WX_LIBS_STATIC="" 879 | WX_RESCOMP="" 880 | 881 | ifelse([$3], , :, [$3]) 882 | 883 | fi 884 | 885 | AC_SUBST(WX_CPPFLAGS) 886 | AC_SUBST(WX_CFLAGS) 887 | AC_SUBST(WX_CXXFLAGS) 888 | AC_SUBST(WX_CFLAGS_ONLY) 889 | AC_SUBST(WX_CXXFLAGS_ONLY) 890 | AC_SUBST(WX_LIBS) 891 | AC_SUBST(WX_LIBS_STATIC) 892 | AC_SUBST(WX_VERSION) 893 | AC_SUBST(WX_RESCOMP) 894 | ]) 895 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | --------------------------------------------------------------------------------