aboutsummaryrefslogtreecommitdiffstats
path: root/translate/mcode
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-07-10 21:00:41 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-07-10 21:00:41 +0000
commit3841c37a946481815c89928ccd15b71b608aa526 (patch)
treeed57a888c7e291c0ac2b26aa717fff38392bd43f /translate/mcode
parent06c89bf159a88b4339295b6007ff40bee14dd618 (diff)
downloadghdl-3841c37a946481815c89928ccd15b71b608aa526.tar.gz
ghdl-3841c37a946481815c89928ccd15b71b608aa526.tar.bz2
ghdl-3841c37a946481815c89928ccd15b71b608aa526.zip
updated for 0.24
Diffstat (limited to 'translate/mcode')
-rwxr-xr-xtranslate/mcode/dist.sh4
-rw-r--r--translate/mcode/windows/ghdl.nsi60
2 files changed, 58 insertions, 6 deletions
diff --git a/translate/mcode/dist.sh b/translate/mcode/dist.sh
index e28bec6c8..132ba0b59 100755
--- a/translate/mcode/dist.sh
+++ b/translate/mcode/dist.sh
@@ -192,6 +192,8 @@ done
for i in $windows_files; do
ln -sf $CWD/windows/$i $distdir/windows/$i
done
+ echo "!define VERSION \"$VERSION\"" > $distdir/windows/version.nsi
+
ln -sf $CWD/winbuild.bat $distdir/winbuild.bat
@@ -439,7 +441,7 @@ EOF
}
if [ $# -eq 0 ]; then
- do_Makefile;
+ do_zip;
else
for i ; do
case $i in
diff --git a/translate/mcode/windows/ghdl.nsi b/translate/mcode/windows/ghdl.nsi
index ec186ef32..4aeab9c8d 100644
--- a/translate/mcode/windows/ghdl.nsi
+++ b/translate/mcode/windows/ghdl.nsi
@@ -5,19 +5,20 @@
; Check if administrator
; uninstall support
; TODO:
-; * Add in PATH
; * Add version
; * Check if GHDL is already installed (and uninstall before)
-; * Check Windows version
+; * Doc
; * Allow user install
;--------------------------------
+!include version.nsi
+;--------------------------------
; The name of the installer
Name "Ghdl"
; The file to write
-OutFile "ghdl-install.exe"
+OutFile "ghdl-installer-${VERSION}.exe"
SetDateSave on
@@ -34,6 +35,7 @@ LicenseData ..\COPYING
;--------------------------------
; Pages
+
Page license
Page components
Page directory
@@ -58,6 +60,48 @@ nt_ok:
Quit
Admin:
+
+ ;;; Check if already installed.
+ ReadRegStr $0 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors not_installed
+ ReadRegStr $0 HKLM "Software\Ghdl" "Version"
+ IfErrors unknown_prev_version
+ Goto known_version
+unknown_prev_version:
+ StrCpy $0 "(unknown)"
+known_version:
+ MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "You already have GHDL version $0 installed. Deinstall ?" IDCANCEL install_abort IDOK deinstall
+install_abort:
+ Abort "Installation aborted"
+deinstall:
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString"
+ IfErrors deinstall_failed
+
+ ; First version of the GHDL installer adds quotes
+ StrCpy $1 $0 1
+ StrCmp $1 '"' 0 str_ok
+ StrCpy $1 $0 "" 1
+ StrCpy $0 $1 -1
+str_ok:
+
+ ; Read install dir
+ ReadRegStr $1 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors deinstall_failed
+
+; MessageBox MB_OK 'copy $0 to $TEMP'
+
+ ClearErrors
+; MessageBox MB_OK 'copy $0 to $TEMP'
+ CopyFiles $0 $TEMP
+ IfErrors deinstall_failed
+ ExecWait '"$TEMP\uninst-ghdl.exe" /S _?=$1'
+ IfErrors deinstall_failed
+ Delete "$TEMP\uninst-ghdl.exe"
+ Return
+deinstall_failed:
+ Delete $TEMP\uninst-ghdl.exe
+ MessageBox MB_YESNO|MB_ICONSTOP "Can't deinstall GHDL: de-installer not found or failed. Continue installation ?" IDNO install_abort
+not_installed:
Return
FunctionEnd
@@ -76,11 +120,13 @@ Section "Ghdl Compiler (required)"
File /oname=COPYING.txt ..\COPYING
; Write the installation path into the registry
- WriteRegStr HKLM "Software\Ghdl" "Install_Dir" "$INSTDIR"
+ WriteRegStr HKLM "Software\Ghdl" "Install_Dir" $INSTDIR
+ ; Write te version
+ WriteRegStr HKLM "Software\Ghdl" "Version" ${VERSION}
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "DisplayName" "Ghdl"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" '"$INSTDIR\uninst-ghdl.exe"'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" $INSTDIR\uninst-ghdl.exe
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoRepair" 1
WriteUninstaller $INSTDIR\uninst-ghdl.exe"
@@ -102,6 +148,10 @@ Section "Synopsys libraries (Recommanded)"
File /r ..\lib\v93\synopsys
SectionEnd
+Section "Documentation (Recommanded)"
+ File ghdl.htm
+SectionEnd
+
Section "Add in PATH (Recommanded)"
WriteRegDWORD HKLM "Software\Ghdl" "PathSet" 1
Push $INSTDIR\Bin