; @name Sugar on a Stick: Emulation ; @version 0-UNREL ; @author Luke Faraone ;Includes and vars !include "MUI2.nsh" !include LogicLib.nsh !define VBX_URL "http://download.virtualbox.org/virtualbox/2.1.4/VirtualBox-2.1.4-42893-Win_x86.msi" ;General ;Name and file Name "Sugar on a Stick: Emulation" OutFile "soas-emu.exe" ;Default installation folder InstallDir "$PROGRAMFILES32\SoaS-emu" ; is there a good reason to use the 32bit folder as opposed to x64? ;Request application "root" privileges for Windows 6.0+ RequestExecutionLevel admin ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING ;-------------------------------- ; Macros Function GetVBX MessageBox MB_OK "You selected to install VirtualBox, \ it will now be downloaded and installed." StrCpy $2 "$TEMP\vbox.msi" nsisdl::download /TIMEOUT=30000 ${VBX_URL} $2 Pop $R0 ;Get the return value StrCmp $R0 "success" +3 MessageBox MB_OK "Download failed: $R0" Quit ExecWait $2 Delete $2 FunctionEnd Function DetectVBX ReadRegStr $2 HKLM "SOFTWARE\Sun\xVM VirtualBox" \ "Version" ${If} $2 == "" Call GetVBX ${EndIf} done: FunctionEnd ;-------------------------------- ;Pages !insertmacro MUI_PAGE_LICENSE "LICENSE.components" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections Section "Sugar disk image" SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File "soas.img" AddSize 300000 ; more or less ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd Section "VirtualBox Virtual Machine" AddSize 75000 Call DetectVBX SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_SecDummy ${LANG_ENGLISH} "A test section." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\Uninstall.exe" RMDir "$INSTDIR" DeleteRegKey /ifempty HKCU "Software\Modern UI Test" SectionEnd