Changeset b4723b0d in rtems


Ignore:
Timestamp:
Aug 4, 2006, 9:47:17 AM (13 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
5aafd7a
Parents:
7eb4d4b
Message:

Generate the batch files when installing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/mingw/rtems-tools.nsi

    r7eb4d4b rb4723b0d  
    2929; Welcome page
    3030!insertmacro MUI_PAGE_WELCOME
    31 ; Components page
    3231; Details of what will happen.
    3332Page custom RTEMSMessage
     33; License page
     34;!define MUI_LICENSEPAGE_CHECKBOX
     35!insertmacro MUI_PAGE_LICENSE "${RTEMS_LICENSE_FILE}"
     36; Components page
    3437!insertmacro MUI_PAGE_COMPONENTS
    3538; Directory page
     
    5558
    5659Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})"
    57 OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_VERSION}.exe"
    58 InstallDir "C:\rtems"
     60OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_BUILD_VERSION}.exe"
     61InstallDir "C:\rtems\${RTEMS_TARGET}"
    5962ShowInstDetails show
    6063ShowUnInstDetails show
     
    6568
    6669Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
     70 SetOutPath "$INSTDIR"
     71 File "${RTEMS_SOURCE}/AUTHORS"
     72 File "${RTEMS_SOURCE}/COPYING"
     73 File "${RTEMS_SOURCE}/README"
    6774 !insertmacro RTEMS_INSTALL_FILES
    6875SectionEnd
     76
     77!macro FILE_WRITE_LINE Handle Text
     78  FileWrite     ${Handle} `${Text}`
     79  FileWriteByte ${Handle} "13"
     80  FileWriteByte ${Handle} "10"
     81!macroend
    6982
    7083Function .onInit
     
    100113    GetDlgItem $R1 $R0 1202 ;1200 + Field number - 1
    101114    ;$R1 contains the HWND of the first field
    102     CreateFont $R2 "Tahoma" "9" "550"
     115    CreateFont $R2 "Tahoma" "8" "300"
    103116    SendMessage $R1 ${WM_SETFONT} $R2 0
    104117       
    105118    GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1
    106119    ;$R1 contains the HWND of the first field
    107     CreateFont $R2 "Tahoma" "9" "550"
     120    CreateFont $R2 "Tahoma" "8" "300"
    108121    SendMessage $R1 ${WM_SETFONT} $R2 0
    109122       
    110123    GetDlgItem $R1 $R0 1204 ;1200 + Field number - 1
    111124    ;$R1 contains the HWND of the first field
    112     CreateFont $R2 "Tahoma" "9" "550"
     125    CreateFont $R2 "Tahoma" "8" "300"
    113126    SendMessage $R1 ${WM_SETFONT} $R2 0
    114127       
    115128    GetDlgItem $R1 $R0 1205 ;1200 + Field number - 1
    116129    ;$R1 contains the HWND of the first field
    117     CreateFont $R2 "Tahoma" "9" "550"
     130    CreateFont $R2 "Tahoma" "8" "300"
     131    SendMessage $R1 ${WM_SETFONT} $R2 0
     132       
     133    GetDlgItem $R1 $R0 1206 ;1200 + Field number - 1
     134    ;$R1 contains the HWND of the first field
     135    CreateFont $R2 "Tahoma" "8" "300"
    118136    SendMessage $R1 ${WM_SETFONT} $R2 0
    119137       
     
    127145FunctionEnd
    128146
     147Section -BatchFiles
     148 FileOpen $9 $INSTDIR\rtems.bat w
     149 !insertmacro FILE_WRITE_LINE $9 "@echo off"
     150 !insertmacro FILE_WRITE_LINE $9 "rem RTEMS batch file: ${RTEMS_TARGET} (${RTEMS_VERSION})"
     151 !insertmacro FILE_WRITE_LINE $9 "set PATH=c:\rtems\${RTEMS_TARGET}\bin;c:\mingw\bin;c:\msys\1.0\bin;%PATH%"
     152 !insertmacro FILE_WRITE_LINE $9 "set PROMPT=RTEMS(${RTEMS_TARGET}) $$P$$G"
     153 !insertmacro FILE_WRITE_LINE $9 "If $\"x%OS%x$\" == $\"xWindows_NTx$\" Goto WinNT_Title"
     154 !insertmacro FILE_WRITE_LINE $9 "doskey > Nul"
     155 !insertmacro FILE_WRITE_LINE $9 "goto Finished"
     156 !insertmacro FILE_WRITE_LINE $9 ":WinNT_Title"
     157 !insertmacro FILE_WRITE_LINE $9 "Title RTEMS(${RTEMS_TARGET})"
     158 !insertmacro FILE_WRITE_LINE $9 ":Finished"
     159 FileClose $9
     160
     161 FileOpen $9 $INSTDIR\rtems-cmd.bat w
     162 !insertmacro FILE_WRITE_LINE $9 "@echo off"
     163 !insertmacro FILE_WRITE_LINE $9 "rem RTEMS batch file: ${RTEMS_TARGET} (${RTEMS_VERSION})"
     164 !insertmacro FILE_WRITE_LINE $9 "If $\"x%OS%x$\" == $\"xWindows_NTx$\" Goto WinNT"
     165 !insertmacro FILE_WRITE_LINE $9 "start command.com /e:4096 /k $INSTDIR\rtems.bat %1 %2 %3 %4"
     166 !insertmacro FILE_WRITE_LINE $9 "exit"
     167 !insertmacro FILE_WRITE_LINE $9 ":WinNT"
     168 !insertmacro FILE_WRITE_LINE $9 "start cmd.exe /k $INSTDIR\rtems.bat %1 %2 %3 %4"
     169 !insertmacro FILE_WRITE_LINE $9 "exit"
     170 FileClose $9
     171
     172 FileOpen $9 $INSTDIR\sh-run.bat w
     173 !insertmacro FILE_WRITE_LINE $9 "@echo off"
     174 !insertmacro FILE_WRITE_LINE $9 "rem We can only handle 9 parameters. More is too hard."
     175 !insertmacro FILE_WRITE_LINE $9 "call $INSTDIR\rtems.bat"
     176 !insertmacro FILE_WRITE_LINE $9 "%1 %2 %3 %4 %5 %6 %7 %8 %9"
     177 FileClose $9
     178
     179 FileOpen $9 $INSTDIR\vs-make.sh w
     180 !insertmacro FILE_WRITE_LINE $9 "#! /bin/sh"
     181 !insertmacro FILE_WRITE_LINE $9 "if [ ! -d $$1 ]; then"
     182 !insertmacro FILE_WRITE_LINE $9 " echo $\"error: no build directory found$\""
     183 !insertmacro FILE_WRITE_LINE $9 " exit 1"
     184 !insertmacro FILE_WRITE_LINE $9 "fi"
     185 !insertmacro FILE_WRITE_LINE $9 "cd $$1"
     186 !insertmacro FILE_WRITE_LINE $9 "shift"
     187 !insertmacro FILE_WRITE_LINE $9 "make $$* 2>&1 | sed -e 's/c:\([0-9]*\):/c(\1):/' \\"
     188 !insertmacro FILE_WRITE_LINE $9 "                   -e 's/h:\([0-9]*\):/h(\1):/' \\"
     189 !insertmacro FILE_WRITE_LINE $9 "                   -e 's/S:\([0-9]*\):/S(\1):/' \\"
     190 !insertmacro FILE_WRITE_LINE $9 "                   -e 's/s:\([0-9]*\):/s(\1):/'"
     191 FileClose $9
     192SectionEnd
     193
    129194Section -Post
    130  WriteUninstaller "$INSTDIR\uninst.exe"
     195 WriteUninstaller "$INSTDIR\rtems-${RTEMS_TARGET}-uninst.exe"
    131196 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
    132197                  "DisplayName" "$(^Name)"
     
    148213
    149214Section Uninstall
    150  Delete $INSTDIR\Uninst.exe
     215 Delete $INSTDIR\rtems-${RTEMS_TARGET}-uninst.exe
    151216 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
    152217 DetailPrint "Delete the install directory"
     218 Delete "$INSTDIR\AUTHORS"
     219 Delete "$INSTDIR\COPYING"
     220 Delete "$INSTDIR\README"
     221 Delete "$INSTDIR\rtems.bat"
     222 Delete "$INSTDIR\rtems-cmd.bat"
     223 Delete "$INSTDIR\sh-run.bat"
     224 Delete "$INSTDIR\vs-make.sh"
    153225 !insertmacro RTEMS_DELETE_FILES
    154226 DetailPrint "All done."
Note: See TracChangeset for help on using the changeset viewer.