mirror of
https://github.com/t-crest/rtems.git
synced 2025-12-25 16:57:56 +00:00
Generate the batch files when installing.
This commit is contained in:
@@ -28,9 +28,12 @@
|
|||||||
|
|
||||||
; Welcome page
|
; Welcome page
|
||||||
!insertmacro MUI_PAGE_WELCOME
|
!insertmacro MUI_PAGE_WELCOME
|
||||||
; Components page
|
|
||||||
; Details of what will happen.
|
; Details of what will happen.
|
||||||
Page custom RTEMSMessage
|
Page custom RTEMSMessage
|
||||||
|
; License page
|
||||||
|
;!define MUI_LICENSEPAGE_CHECKBOX
|
||||||
|
!insertmacro MUI_PAGE_LICENSE "${RTEMS_LICENSE_FILE}"
|
||||||
|
; Components page
|
||||||
!insertmacro MUI_PAGE_COMPONENTS
|
!insertmacro MUI_PAGE_COMPONENTS
|
||||||
; Directory page
|
; Directory page
|
||||||
!insertmacro MUI_PAGE_DIRECTORY
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
@@ -54,8 +57,8 @@ ReserveFile "rtems.ini"
|
|||||||
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
||||||
|
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})"
|
Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})"
|
||||||
OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_VERSION}.exe"
|
OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_BUILD_VERSION}.exe"
|
||||||
InstallDir "C:\rtems"
|
InstallDir "C:\rtems\${RTEMS_TARGET}"
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
ShowUnInstDetails show
|
ShowUnInstDetails show
|
||||||
BrandingText "RTEMS ${RTEMS_TARGET} Tools v${PRODUCT_VERSION}"
|
BrandingText "RTEMS ${RTEMS_TARGET} Tools v${PRODUCT_VERSION}"
|
||||||
@@ -64,9 +67,19 @@ AutoCloseWindow false
|
|||||||
CRCCheck force
|
CRCCheck force
|
||||||
|
|
||||||
Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
|
Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
|
File "${RTEMS_SOURCE}/AUTHORS"
|
||||||
|
File "${RTEMS_SOURCE}/COPYING"
|
||||||
|
File "${RTEMS_SOURCE}/README"
|
||||||
!insertmacro RTEMS_INSTALL_FILES
|
!insertmacro RTEMS_INSTALL_FILES
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
!macro FILE_WRITE_LINE Handle Text
|
||||||
|
FileWrite ${Handle} `${Text}`
|
||||||
|
FileWriteByte ${Handle} "13"
|
||||||
|
FileWriteByte ${Handle} "10"
|
||||||
|
!macroend
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
;Extract InstallOptions INI files
|
;Extract InstallOptions INI files
|
||||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "rtems.ini"
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "rtems.ini"
|
||||||
@@ -99,22 +112,27 @@ Function RTEMSMessage
|
|||||||
|
|
||||||
GetDlgItem $R1 $R0 1202 ;1200 + Field number - 1
|
GetDlgItem $R1 $R0 1202 ;1200 + Field number - 1
|
||||||
;$R1 contains the HWND of the first field
|
;$R1 contains the HWND of the first field
|
||||||
CreateFont $R2 "Tahoma" "9" "550"
|
CreateFont $R2 "Tahoma" "8" "300"
|
||||||
SendMessage $R1 ${WM_SETFONT} $R2 0
|
SendMessage $R1 ${WM_SETFONT} $R2 0
|
||||||
|
|
||||||
GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1
|
GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1
|
||||||
;$R1 contains the HWND of the first field
|
;$R1 contains the HWND of the first field
|
||||||
CreateFont $R2 "Tahoma" "9" "550"
|
CreateFont $R2 "Tahoma" "8" "300"
|
||||||
SendMessage $R1 ${WM_SETFONT} $R2 0
|
SendMessage $R1 ${WM_SETFONT} $R2 0
|
||||||
|
|
||||||
GetDlgItem $R1 $R0 1204 ;1200 + Field number - 1
|
GetDlgItem $R1 $R0 1204 ;1200 + Field number - 1
|
||||||
;$R1 contains the HWND of the first field
|
;$R1 contains the HWND of the first field
|
||||||
CreateFont $R2 "Tahoma" "9" "550"
|
CreateFont $R2 "Tahoma" "8" "300"
|
||||||
SendMessage $R1 ${WM_SETFONT} $R2 0
|
SendMessage $R1 ${WM_SETFONT} $R2 0
|
||||||
|
|
||||||
GetDlgItem $R1 $R0 1205 ;1200 + Field number - 1
|
GetDlgItem $R1 $R0 1205 ;1200 + Field number - 1
|
||||||
;$R1 contains the HWND of the first field
|
;$R1 contains the HWND of the first field
|
||||||
CreateFont $R2 "Tahoma" "9" "550"
|
CreateFont $R2 "Tahoma" "8" "300"
|
||||||
|
SendMessage $R1 ${WM_SETFONT} $R2 0
|
||||||
|
|
||||||
|
GetDlgItem $R1 $R0 1206 ;1200 + Field number - 1
|
||||||
|
;$R1 contains the HWND of the first field
|
||||||
|
CreateFont $R2 "Tahoma" "8" "300"
|
||||||
SendMessage $R1 ${WM_SETFONT} $R2 0
|
SendMessage $R1 ${WM_SETFONT} $R2 0
|
||||||
|
|
||||||
InstallOptions::show
|
InstallOptions::show
|
||||||
@@ -126,8 +144,55 @@ Function RTEMSMessage
|
|||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Section -BatchFiles
|
||||||
|
FileOpen $9 $INSTDIR\rtems.bat w
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "@echo off"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "rem RTEMS batch file: ${RTEMS_TARGET} (${RTEMS_VERSION})"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "set PATH=c:\rtems\${RTEMS_TARGET}\bin;c:\mingw\bin;c:\msys\1.0\bin;%PATH%"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "set PROMPT=RTEMS(${RTEMS_TARGET}) $$P$$G"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "If $\"x%OS%x$\" == $\"xWindows_NTx$\" Goto WinNT_Title"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "doskey > Nul"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "goto Finished"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 ":WinNT_Title"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "Title RTEMS(${RTEMS_TARGET})"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 ":Finished"
|
||||||
|
FileClose $9
|
||||||
|
|
||||||
|
FileOpen $9 $INSTDIR\rtems-cmd.bat w
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "@echo off"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "rem RTEMS batch file: ${RTEMS_TARGET} (${RTEMS_VERSION})"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "If $\"x%OS%x$\" == $\"xWindows_NTx$\" Goto WinNT"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "start command.com /e:4096 /k $INSTDIR\rtems.bat %1 %2 %3 %4"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "exit"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 ":WinNT"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "start cmd.exe /k $INSTDIR\rtems.bat %1 %2 %3 %4"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "exit"
|
||||||
|
FileClose $9
|
||||||
|
|
||||||
|
FileOpen $9 $INSTDIR\sh-run.bat w
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "@echo off"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "rem We can only handle 9 parameters. More is too hard."
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "call $INSTDIR\rtems.bat"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "%1 %2 %3 %4 %5 %6 %7 %8 %9"
|
||||||
|
FileClose $9
|
||||||
|
|
||||||
|
FileOpen $9 $INSTDIR\vs-make.sh w
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "#! /bin/sh"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "if [ ! -d $$1 ]; then"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 " echo $\"error: no build directory found$\""
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 " exit 1"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "fi"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "cd $$1"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "shift"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 "make $$* 2>&1 | sed -e 's/c:\([0-9]*\):/c(\1):/' \\"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 " -e 's/h:\([0-9]*\):/h(\1):/' \\"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 " -e 's/S:\([0-9]*\):/S(\1):/' \\"
|
||||||
|
!insertmacro FILE_WRITE_LINE $9 " -e 's/s:\([0-9]*\):/s(\1):/'"
|
||||||
|
FileClose $9
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
Section -Post
|
Section -Post
|
||||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
WriteUninstaller "$INSTDIR\rtems-${RTEMS_TARGET}-uninst.exe"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
|
||||||
"DisplayName" "$(^Name)"
|
"DisplayName" "$(^Name)"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
|
||||||
@@ -147,9 +212,16 @@ Function un.onInit
|
|||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
Delete $INSTDIR\Uninst.exe
|
Delete $INSTDIR\rtems-${RTEMS_TARGET}-uninst.exe
|
||||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||||
DetailPrint "Delete the install directory"
|
DetailPrint "Delete the install directory"
|
||||||
|
Delete "$INSTDIR\AUTHORS"
|
||||||
|
Delete "$INSTDIR\COPYING"
|
||||||
|
Delete "$INSTDIR\README"
|
||||||
|
Delete "$INSTDIR\rtems.bat"
|
||||||
|
Delete "$INSTDIR\rtems-cmd.bat"
|
||||||
|
Delete "$INSTDIR\sh-run.bat"
|
||||||
|
Delete "$INSTDIR\vs-make.sh"
|
||||||
!insertmacro RTEMS_DELETE_FILES
|
!insertmacro RTEMS_DELETE_FILES
|
||||||
DetailPrint "All done."
|
DetailPrint "All done."
|
||||||
SetAutoClose true
|
SetAutoClose true
|
||||||
|
|||||||
Reference in New Issue
Block a user