tazusb rev 60

Add tazusb.nsi source (tazusb for windows)
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 19 21:35:22 2010 +0100 (2010-02-19)
parents 59f5261bc541
children 4856f473663b
files po/tazusbbox/fr.po tazusb.nsi
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/po/tazusbbox/fr.po	Fri Feb 19 21:35:22 2010 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +# French translations for PACKAGE package.
     1.5 +# Copyright (C) 2010 THE PACKAGE'S COPYRIGHT HOLDER
     1.6 +# This file is distributed under the same license as the PACKAGE package.
     1.7 +# Linux User <pankso@slitaz.org>, 2010.
     1.8 +#
     1.9 +msgid ""
    1.10 +msgstr ""
    1.11 +"Project-Id-Version: tazusbbox VERSION\n"
    1.12 +"Report-Msgid-Bugs-To: \n"
    1.13 +"POT-Creation-Date: 2010-02-18 00:17+0100\n"
    1.14 +"PO-Revision-Date: 2010-02-17 22:58+0100\n"
    1.15 +"Last-Translator: Christophe Lincoln <pankso@slitaz.org>\n"
    1.16 +"Language-Team: French\n"
    1.17 +"MIME-Version: 1.0\n"
    1.18 +"Content-Type: text/plain; charset=UTF-8\n"
    1.19 +"Content-Transfer-Encoding: 8bit\n"
    1.20 +"Plural-Forms: nplurals=2; plural=(n > 1);\n"
    1.21 +
    1.22 +#: tazusbbox:43
    1.23 +msgid "TazUSB Box"
    1.24 +msgstr "TazUSB Box"
    1.25 +
    1.26 +#: tazusbbox:47
    1.27 +msgid ""
    1.28 +"\n"
    1.29 +"Generate SliTaz LiveUSB media and boot in RAM! Insert a LiveCD into\n"
    1.30 +"the cdrom drive, select the correct device and press Generate.\n"
    1.31 +msgstr ""
    1.32 +"\n"
    1.33 +"Générer un LiveUSB de SliTaz et démarrer! Insérer un LiveCD dans\n"
    1.34 +"le lecteur de cdrom, séléctionner le media et appuyer sur générer.\n"
    1.35 +
    1.36 +#: tazusbbox:53
    1.37 +msgid "ISO to USB (Optional default is CDROM)"
    1.38 +msgstr "ISO vers USB (En option, CDROM utilisé par défaut)"
    1.39 +
    1.40 +#: tazusbbox:56
    1.41 +msgid "<b>ISO image:</b>"
    1.42 +msgstr "<b>Image ISO:</b>"
    1.43 +
    1.44 +#: tazusbbox:70
    1.45 +msgid "<b>USB Media:</b>"
    1.46 +msgstr "<b>Media USB:</b>"
    1.47 +
    1.48 +#: tazusbbox:83
    1.49 +msgid "Not found"
    1.50 +msgstr "Introuvé"
    1.51 +
    1.52 +#: tazusbbox:90
    1.53 +msgid "Generate"
    1.54 +msgstr "Générer"
    1.55 +
    1.56 +#: tazusbbox:96
    1.57 +msgid "Exit"
    1.58 +msgstr "Quitter"
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tazusb.nsi	Fri Feb 19 21:35:22 2010 +0100
     2.3 @@ -0,0 +1,347 @@
     2.4 +; Tazusb
     2.5 +; Windows installer for Slitaz
     2.6 +; (c) 2009 Cedric Tissieres (slitaz@objectif-securite.ch)
     2.7 +; You'll need to put 7z.exe and 7z.dll from http://www.7-zip.org/ and syslinux.exe from http://syslinux.zytor.com/ 
     2.8 +; in the NSIS plugins directory before compiling the script. Adapt the FROM_DIR constant too. 
     2.9 +; To add a translation, add the corresponding "!insertmacro MUI_LANGUAGE" and translates all the LangString you'll find below.  
    2.10 +
    2.11 +!define NAME "TazUSB - SliTaz LiveUSB utility "
    2.12 +!define FILENAME "tazusb"
    2.13 +!define VERSION "v0.2"
    2.14 +!define FROM_DIR "C:\ophcrack\livecd"
    2.15 +
    2.16 +SetCompressor LZMA
    2.17 +CRCCheck On
    2.18 +XPStyle on
    2.19 +
    2.20 +!include "MUI2.nsh"
    2.21 +!include "FileFunc.nsh"
    2.22 +
    2.23 +
    2.24 +# MUI Settings #####################################
    2.25 +;**************
    2.26 +
    2.27 +; Interface settings
    2.28 +!define MUI_FINISHPAGE_NOAUTOCLOSE
    2.29 +!define MUI_HEADERIMAGE
    2.30 +!define MUI_HEADERIMAGE_BITMAP "${FROM_DIR}\slitaz-logo-nsis.bmp" 
    2.31 +!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
    2.32 +
    2.33 +; Welcome page
    2.34 +!define MUI_WELCOMEPAGE_TITLE $(Welcome_Title)
    2.35 +!define MUI_WELCOMEPAGE_TEXT $(Welcome_Text)
    2.36 +!insertmacro MUI_PAGE_WELCOME
    2.37 +; ISO page
    2.38 +Var IsoFileHw
    2.39 +Var IsoFile
    2.40 +Var Label
    2.41 +Var Label2
    2.42 +Page custom isoFilePage
    2.43 +; Drive page
    2.44 +Var DestDriveHW
    2.45 +Var DestDrive
    2.46 +Page custom drivePage
    2.47 +; Warning page
    2.48 +Page custom warningPage
    2.49 +; Instfiles page
    2.50 +!insertmacro MUI_PAGE_INSTFILES
    2.51 +; Finish page
    2.52 +!define MUI_FINISHPAGE_TITLE $(Finish_Title)
    2.53 +!define MUI_FINISHPAGE_TEXT $(Finish_Text)
    2.54 +!define MUI_FINISHPAGE_LINK $(Finish_Link)
    2.55 +!define MUI_FINISHPAGE_LINK_LOCATION "http://slitaz.org"
    2.56 +!insertmacro MUI_PAGE_FINISH
    2.57 +
    2.58 +; Language files
    2.59 +!insertmacro MUI_LANGUAGE "English" ;first language is the default language
    2.60 +!insertmacro MUI_LANGUAGE "French"
    2.61 +!insertmacro MUI_LANGUAGE "Portuguese"
    2.62 +
    2.63 +
    2.64 +; Reserve files
    2.65 +
    2.66 +; MUI end ------
    2.67 +
    2.68 +; General Parameters
    2.69 +Name "${NAME} ${VERSION}"
    2.70 +OutFile "${FROM_DIR}\${FILENAME}.exe"
    2.71 +
    2.72 +# Languages ######################################
    2.73 +
    2.74 +; English
    2.75 +LangString Welcome_Title ${LANG_ENGLISH} "${NAME}"
    2.76 +LangString Welcome_Text ${LANG_ENGLISH} "Welcome to TazUSB. This tool will help you installing Slitaz on a USB drive."
    2.77 +LangString Finish_Title ${LANG_ENGLISH} "TazUSB has completed Slitaz installation."
    2.78 +LangString Finish_Text ${LANG_ENGLISH} "Slitaz is now installed on your USB drive and the drive is bootable."
    2.79 +LangString Finish_Link ${LANG_ENGLISH} "Slitaz website"
    2.80 +LangString IsoPage_Title ${LANG_ENGLISH} "Select ISO file"
    2.81 +LangString IsoPage_Title2 ${LANG_ENGLISH} "Choose the ISO image which will be installed on your USB drive."
    2.82 +LangString IsoPage_Text ${LANG_ENGLISH} "Select Slitaz ISO file to be installed on your USB drive. You can download it on http://www.slitaz.org if needed."
    2.83 +LangString IsoPage_Input ${LANG_ENGLISH} "Slitaz ISO File"
    2.84 +LangString IsoFile ${LANG_ENGLISH} "ISO file|*.iso"
    2.85 +LangString DrivePage_Title ${LANG_ENGLISH} "Choose USB drive location"
    2.86 +LangString DrivePage_Title2 ${LANG_ENGLISH} "Choose the USB drive in which to install Slitaz."
    2.87 +LangString DrivePage_Text ${LANG_ENGLISH} "TazUSB will install Slitaz in the following drive. Make sure that this drive can be safely deleted! Click Next to continue."
    2.88 +LangString DrivePage_Input ${LANG_ENGLISH} "Destination USB Drive"
    2.89 +LangString WarningPage_Title ${LANG_ENGLISH} "Warning!"
    2.90 +LangString WarningPage_Title2 ${LANG_ENGLISH} "TazUSB is ready to install Slitaz on the selected drive."
    2.91 +LangString WarningPage_Text ${LANG_ENGLISH} "TazUSB is now ready to install Slitaz from:$\r$\n$\r$\n$IsoFile $\r$\n$\r$\non your selected destination USB drive:$\r$\n$\r$\n$DestDrive. $\r$\n$\r$\nThe contents of this drive will be deleted! If you are sure, click Next to continue."
    2.92 +LangString Iso2USB_Extract ${LANG_ENGLISH} "Extract files from $IsoFile"
    2.93 +LangString Iso2USB_CreateSyslinux ${LANG_ENGLISH} "Create syslinux configuration files on $DestDrive"
    2.94 +LangString Iso2USB_ExecuteSyslinux ${LANG_ENGLISH} "Execute syslinux on $R0"
    2.95 +LangString Iso2USB_WarningSyslinux ${LANG_ENGLISH} "An error ($R8) happened when executing syslinux.$\r$\nYour USB drive won't be bootable..."
    2.96 +
    2.97 +; French
    2.98 +LangString Welcome_Title ${LANG_FRENCH} "${NAME}"
    2.99 +LangString Welcome_Text ${LANG_FRENCH} "Bienvenue dans TazUSB. Cet outil va vous aider à installer Slitaz sur une clé USB."
   2.100 +LangString Finish_Title ${LANG_FRENCH} "L'installation a été terminée par TazUSB."
   2.101 +LangString Finish_Text ${LANG_FRENCH} "Slitaz est maintenant installé sur votre clé USB et celle-ci est démarrable."
   2.102 +LangString Finish_Link ${LANG_FRENCH} "Site web de Slitaz"
   2.103 +LangString IsoPage_Title ${LANG_FRENCH} "Sélectionner un fichier ISO"
   2.104 +LangString IsoPage_Title2 ${LANG_FRENCH} "Choisissez l'image ISO qui sera installée sur votre clé USB."
   2.105 +LangString IsoPage_Text ${LANG_FRENCH} "Sélectionnez l'image ISO de Slitaz qui sera installée sur votre clé USB. Vous pouvez en télécharger une sur http://www.slitaz.org au besoin."
   2.106 +LangString IsoPage_Input ${LANG_FRENCH} "Image ISO Slitaz"
   2.107 +LangString IsoFile ${LANG_FRENCH} "Image ISO|*.iso"
   2.108 +LangString DrivePage_Title ${LANG_FRENCH} "Sélectionner un lecteur USB"
   2.109 +LangString DrivePage_Title2 ${LANG_FRENCH} "Choisissez le lecteur USB sur lequel sera installé Slitaz"
   2.110 +LangString DrivePage_Text ${LANG_FRENCH} "TazUSB va maintenant installer Slitaz sur le lecteur sélectionné ci-dessous. Assurez-vous que les données contenues sur cette clé peuvent être effacées! Cliquer sur Suivant pour continuer."
   2.111 +LangString DrivePage_Input ${LANG_FRENCH} "Lecteur USB de destination"
   2.112 +LangString WarningPage_Title ${LANG_FRENCH} "Attention!"
   2.113 +LangString WarningPage_Title2 ${LANG_FRENCH} "TazUSB est prêt à installer Slitaz sur le lecteur sélectionné."
   2.114 +LangString WarningPage_Text ${LANG_FRENCH} "TazUSB est maintenant prêt à installer Slitaz depuis:$\r$\n$\r$\n$IsoFile $\r$\n$\r$\nsur le lecteur USB sélectionné:$\r$\n$\r$\n$DestDrive. $\r$\n$\r$\nLe contenu de ce lecteur peut être effacé! Si vous êtes sûr, cliquer sur Suivant pour continuer."
   2.115 +LangString Iso2USB_Extract ${LANG_FRENCH} "Extraction des fichiers de $IsoFile"
   2.116 +LangString Iso2USB_CreateSyslinux ${LANG_FRENCH} "Création de la configuration syslinux sur $DestDrive"
   2.117 +LangString Iso2USB_ExecuteSyslinux ${LANG_FRENCH} "Exécution de syslinux sur $R0"
   2.118 +LangString Iso2USB_WarningSyslinux ${LANG_FRENCH} "Une erreur ($R8) est survenue pendant l'exécution de syslinux.$\r$\n Votre clé USB ne sera pas démarrable..."
   2.119 +
   2.120 +; Portuguese
   2.121 +LangString Welcome_Title ${LANG_PORTUGUESE} "${NAME}"
   2.122 +LangString Welcome_Text ${LANG_PORTUGUESE} "Bem-vindo ao TazUSB. Este aplicativo o ajudará a instalar o SliTaz em um drive USB."
   2.123 +LangString Finish_Title ${LANG_PORTUGUESE} "O TazUSB finalizou a instalação do SliTaz."
   2.124 +LangString Finish_Text ${LANG_PORTUGUESE} "O SliTaz está instalado em seu drive USB e o processo de boot agora pode ser feito."
   2.125 +LangString Finish_Link ${LANG_PORTUGUESE} "Site do Slitaz"
   2.126 +LangString IsoPage_Title ${LANG_PORTUGUESE} "Selecionar arquivo ISO"
   2.127 +LangString IsoPage_Title2 ${LANG_PORTUGUESE} "Escolher imagem ISO a ser instalada no drive USB."
   2.128 +LangString IsoPage_Text ${LANG_PORTUGUESE} "Selecionar imagem ISO do SliTaz a ser instalada no drive USB. Você pode obtê-la, se necessário, em http://www.slitaz.org."
   2.129 +LangString IsoPage_Input ${LANG_PORTUGUESE} "Arquivo ISO do SliTaz"
   2.130 +LangString IsoFile ${LANG_PORTUGUESE} "Arquivo ISO|*.iso"
   2.131 +LangString DrivePage_Title ${LANG_PORTUGUESE} "Escolha a localização do drive USB"
   2.132 +LangString DrivePage_Title2 ${LANG_PORTUGUESE} "Escolha o drive USB no qual o SliTaz será instalado."
   2.133 +LangString DrivePage_Text ${LANG_PORTUGUESE} "O TazUSB instalará o SliTaz no seguinte drive. Certifique-se de que o conteúdo deste drive possa ser seguramente apagado! Clique Next para continuar."
   2.134 +LangString DrivePage_Input ${LANG_PORTUGUESE} "Drive USB de destino"
   2.135 +LangString WarningPage_Title ${LANG_PORTUGUESE} "Aviso!"
   2.136 +LangString WarningPage_Title2 ${LANG_PORTUGUESE} "O TazUSB está pronto para instalar o SliTaz no drive selecionado."
   2.137 +LangString WarningPage_Text ${LANG_PORTUGUESE} "O TazUSB está pronto para instalar o SliTaz de:$\r$\n$\r$\n$IsoFile $\r$\n$\r$\nem seu drive de destino selecionado:$\r$\n$\r$\n$DestDrive. $\r$\n$\r$\nO conteúdo deste drive será apagado! Para prosseguir com a operação, clique Next para continuar."
   2.138 +LangString Iso2USB_Extract ${LANG_PORTUGUESE} "Extrair arquivos de $IsoFile"
   2.139 +LangString Iso2USB_CreateSyslinux ${LANG_PORTUGUESE} "Criar arquivos de configuração do syslinux em  $DestDrive"
   2.140 +LangString Iso2USB_ExecuteSyslinux ${LANG_PORTUGUESE} "Executar syslinux em $R0"
   2.141 +LangString Iso2USB_WarningSyslinux ${LANG_PORTUGUESE} "Um erro ($R8) ocorreu durante a execução do syslinux.$\r$\nSeu drive USB não será inicializável..."
   2.142 +
   2.143 +# Functions #######################################
   2.144 +
   2.145 +Function isoFilePage
   2.146 +
   2.147 +  !insertmacro MUI_HEADER_TEXT $(IsoPage_Title) $(IsoPage_Title2) 
   2.148 + 
   2.149 +  nsDialogs::Create 1018
   2.150 +  
   2.151 +  ${If} $IsoFile == ""
   2.152 +    GetDlgItem $6 $HWNDPARENT 1 ; Get "Next" control handle
   2.153 +    EnableWindow $6 0 ; disable "Next" control
   2.154 +  ${EndIf}
   2.155 + 
   2.156 +  ${NSD_CreateLabel} 0 0 100% 30 $(IsoPage_Text)
   2.157 +  Pop $Label
   2.158 +
   2.159 +  ${NSD_CreateLabel} 15 102 100% 15 $(IsoPage_Input)
   2.160 +  Pop $Label2
   2.161 +  
   2.162 +  nsDialogs::CreateControl EDIT ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_READONLY} ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE} 10 120 85% 20 $IsoFile
   2.163 +  Pop $IsoFileHw
   2.164 +        
   2.165 +  ${NSD_CreateBrowseButton} 89% 120 7% 20 ...
   2.166 +  Var /GLOBAL IsoFile_BrowseButton
   2.167 +  Pop $IsoFile_BrowseButton 
   2.168 +  GetFunctionAddress $0 OnClick_IsoFile_BrowseButton
   2.169 +  nsDialogs::OnClick $IsoFile_BrowseButton $0
   2.170 +  
   2.171 +  nsDialogs::Show
   2.172 +FunctionEnd
   2.173 +
   2.174 +Function OnClick_IsoFile_BrowseButton
   2.175 +
   2.176 +
   2.177 +nsDialogs::SelectFileDialog /NOUNLOAD open "" $(IsoFile)
   2.178 +Pop $0
   2.179 +
   2.180 +${If} $0 != ""
   2.181 +   ${NSD_SetText} $IsoFileHw $0
   2.182 +   StrCpy $IsoFile "$0"
   2.183 +   GetDlgItem $6 $HWNDPARENT 1 ; Get "Next" control handle
   2.184 +   EnableWindow $6 1 ; enable "Next" control
   2.185 +${EndIf}
   2.186 +
   2.187 +FunctionEnd
   2.188 +
   2.189 +Function drivePage
   2.190 +
   2.191 +  !insertmacro MUI_HEADER_TEXT $(DrivePage_Title) $(DrivePage_Title2)
   2.192 + 
   2.193 +  nsDialogs::Create 1018
   2.194 +  
   2.195 +  ${If} $DestDrive == ""
   2.196 +    GetDlgItem $6 $HWNDPARENT 1 ; Get "Next" control handle
   2.197 +    EnableWindow $6 0 ; disable "Next" control
   2.198 +  ${EndIf}
   2.199 + 
   2.200 +  ${NSD_CreateLabel} 0 0 100% 30 $(DrivePage_Text)
   2.201 +  Pop $Label
   2.202 +  
   2.203 +  ${NSD_CreateLabel} 15 102 100% 15 $(DrivePage_Input)
   2.204 +  Pop $Label2
   2.205 +  
   2.206 +  ${NSD_CreateDroplist} 10 120 85% 20 ""
   2.207 +	Pop $DestDriveHw
   2.208 +		${NSD_OnChange} $DestDriveHw db_select.onchange
   2.209 +		${GetDrives} "FDD+HDD" driveListFiller
   2.210 +  ${If} $DestDrive != ""
   2.211 +	${NSD_CB_SelectString} $DestDriveHw $DestDrive
   2.212 +  ${EndIf}
   2.213 +  
   2.214 +  nsDialogs::Show
   2.215 +FunctionEnd
   2.216 +
   2.217 +Function db_select.onchange
   2.218 +  Pop $DestDriveHw
   2.219 +  ${NSD_GetText} $DestDriveHw $0
   2.220 +  StrCpy $DestDrive "$0"
   2.221 +  GetDlgItem $6 $HWNDPARENT 1 ; Get "Next" control handle
   2.222 +  EnableWindow $6 1 ; enable "Next" control
   2.223 +FunctionEnd
   2.224 +
   2.225 +Function driveListFiller
   2.226 +	SendMessage $DestDriveHw ${CB_ADDSTRING} 0 "STR:$9"
   2.227 +	Push 1 ; must push something - see GetDrives documentation
   2.228 +FunctionEnd
   2.229 +
   2.230 +Function warningPage
   2.231 +
   2.232 +  !insertmacro MUI_HEADER_TEXT $(WarningPage_Title) $(WarningPage_Title2)
   2.233 + 
   2.234 +  nsDialogs::Create 1018
   2.235 + 
   2.236 +  ${NSD_CreateLabel} 0 0 100% 80% $(WarningPage_Text)
   2.237 +  Pop $Label
   2.238 +  
   2.239 +  nsDialogs::Show
   2.240 +FunctionEnd
   2.241 +
   2.242 +Function ExtractIt
   2.243 +  ; Code taken from 7zarchive.nsh  (c) 2008 qwertymodo
   2.244 +  
   2.245 +  InitPluginsDir
   2.246 +  File /oname=$PLUGINSDIR\7z.exe "${NSISDIR}\plugins\7z.exe"
   2.247 +  File /oname=$PLUGINSDIR\7z.dll "${NSISDIR}\plugins\7z.dll"
   2.248 +
   2.249 +  ClearErrors
   2.250 +
   2.251 +  Exch $0      ; ADDITIONAL_PARAMETERS (added to the end of the program call)
   2.252 +  Exch 1
   2.253 +  Exch $1      ; EXTRACT_PATHS (either "fullpaths" or "nopaths"; defaults to nopaths)
   2.254 +  Exch 2
   2.255 +  Exch $2      ; DESTINATION_FOLDER
   2.256 +  Exch 3
   2.257 +  Exch $3      ; FILE_FILTER (if blank, extracts all files; allows for wildcards, e.g. "*.doc")
   2.258 +  Exch 4
   2.259 +  Exch $4      ; SOURCE_ARCHIVE
   2.260 +  Push $5
   2.261 +
   2.262 +  ;Extract all files if no filter specified
   2.263 +  StrCmp $3 "" +2 0
   2.264 +  StrCpy $3 "$\"$3$\""
   2.265 +
   2.266 +  ;Default folder if not specified
   2.267 +  StrCmp $2 "" 0 GotFolder
   2.268 +  !insertmacro GetParent
   2.269 +  ${GetParent} "$4" $2
   2.270 +  !insertmacro GetBaseName
   2.271 +  ${GetBaseName} "$4" $5
   2.272 +  StrCpy $2 "$2\$5"
   2.273 +
   2.274 +  GotFolder:
   2.275 +  CreateDirectory $2
   2.276 +  StrCmp $1 "fullpaths" 0 +2
   2.277 +  StrCpy $5 "x"
   2.278 +  StrCmp $1 "nopaths" +2 0
   2.279 +  StrCmp $1 "" 0 +2
   2.280 +  StrCpy $5 "e"
   2.281 +
   2.282 +  nsExec::ExecToLog '"$PLUGINSDIR\7z.exe" x $\"$4$\" $\"-o$2$\" $3 $0'
   2.283 +
   2.284 +  Pop $0 ;nsExec return value
   2.285 +
   2.286 +  Pop $5
   2.287 +  Pop $4
   2.288 +  Pop $0
   2.289 +  Pop $1
   2.290 +  Pop $2
   2.291 +  Pop $3
   2.292 +
   2.293 +FunctionEnd
   2.294 +
   2.295 +!macro _ExtractFromArchive SOURCE_ARCHIVE FILE_FILTER DESTINATION_FOLDER EXTRACT_PATHS ADDITIONAL_PARAMETERS
   2.296 +  Push "${SOURCE_ARCHIVE}"
   2.297 +  Push "${FILE_FILTER}"
   2.298 +  Push "${DESTINATION_FOLDER}"
   2.299 +  Push "${EXTRACT_PATHS}"
   2.300 +  Push "${ADDITIONAL_PARAMETERS}"
   2.301 +  Call ExtractIt
   2.302 +!macroend
   2.303 +
   2.304 +!define ExtractFromArchive '!insertmacro "_ExtractFromArchive"'
   2.305 +
   2.306 +
   2.307 +Function .onInit
   2.308 +
   2.309 +  !insertmacro MUI_LANGDLL_DISPLAY
   2.310 +
   2.311 +FunctionEnd
   2.312 +
   2.313 +# Section #######################################
   2.314 +
   2.315 +
   2.316 +Section "iso2usb" main
   2.317 +  InitPluginsDir
   2.318 +  File /oname=$PLUGINSDIR\syslinux.exe "${NSISDIR}\plugins\syslinux.exe"
   2.319 +  
   2.320 +  SetShellVarContext all
   2.321 +  
   2.322 +  ; Extract files from archive
   2.323 +  DetailPrint $(Iso2USB_Extract)
   2.324 +  ${ExtractFromArchive} "$IsoFile" "" "$DestDrive" "" "-y -x![BOOT]*"
   2.325 +
   2.326 +  ; Create syslinux directory and files
   2.327 +  Var /GLOBAL BootDir
   2.328 +  StrCpy $BootDir $DestDrive -1 
   2.329 +  StrCpy $BootDir "$BootDir\boot"
   2.330 +  IfFileExists "$BootDir\syslinux\syslinux.cfg" SkipCreateSyslinux CreateSyslinux
   2.331 +  CreateSyslinux:
   2.332 +  DetailPrint $(Iso2USB_CreateSyslinux) 
   2.333 +  CreateDirectory "$BootDir\syslinux"
   2.334 +  CopyFiles "$BootDir\isolinux\*.*" "$BootDir\syslinux"
   2.335 +  Rename "$BootDir\syslinux\isolinux.cfg" "$BootDir\syslinux\syslinux.cfg"
   2.336 +
   2.337 +  SkipCreateSyslinux:
   2.338 +  ; Execute syslinux on the drive
   2.339 +  StrCpy $R0 $DestDrive -1 ; remove \ for syslinux
   2.340 +  ClearErrors
   2.341 +  DetailPrint $(Iso2USB_ExecuteSyslinux)
   2.342 +   	  ExecWait '$PLUGINSDIR\syslinux.exe -maf -d boot\syslinux $R0' $R8
   2.343 +  	  DetailPrint "Return $R8"
   2.344 +
   2.345 +      Banner::destroy
   2.346 +	  ${If} $R8 != 0
   2.347 +            MessageBox MB_ICONEXCLAMATION|MB_OK $(Iso2USB_WarningSyslinux)
   2.348 +	  ${EndIf}
   2.349 +  
   2.350 +SectionEnd