From 7b358424ebad9349421acd533c2fa1cbf6cf3e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 28 Dec 2016 16:52:56 +0100 Subject: Initial import of xtrkcad version 1:4.0.2-2 --- distribution/win32/CMakeLists.txt | 4 ++++ distribution/win32/nsis/CMakeLists.txt | 17 +++++++++++++++++ distribution/win32/nsis/headerimage.bmp | Bin 0 -> 25818 bytes distribution/win32/nsis/install.nsh | 28 ++++++++++++++++++++++++++++ distribution/win32/nsis/uninstall.nsh | 30 ++++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 distribution/win32/CMakeLists.txt create mode 100644 distribution/win32/nsis/CMakeLists.txt create mode 100755 distribution/win32/nsis/headerimage.bmp create mode 100644 distribution/win32/nsis/install.nsh create mode 100644 distribution/win32/nsis/uninstall.nsh (limited to 'distribution/win32') diff --git a/distribution/win32/CMakeLists.txt b/distribution/win32/CMakeLists.txt new file mode 100644 index 0000000..80ecfe3 --- /dev/null +++ b/distribution/win32/CMakeLists.txt @@ -0,0 +1,4 @@ +SET(CPACK_SOURCE_GENERATOR "ZIP") + +ADD_SUBDIRECTORY(nsis) + diff --git a/distribution/win32/nsis/CMakeLists.txt b/distribution/win32/nsis/CMakeLists.txt new file mode 100644 index 0000000..40d3990 --- /dev/null +++ b/distribution/win32/nsis/CMakeLists.txt @@ -0,0 +1,17 @@ +STRING(REPLACE "/" "\\\\" NATIVE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +SET(CPACK_GENERATOR "NSIS") +SET(CPACK_PACKAGE_ICON "${NATIVE_CURRENT_SOURCE_DIR}\\\\headerimage.bmp") +SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\xtrkcad.exe") +SET(CPACK_NSIS_HELP_LINK "http://www.xtrkcad.org") + +SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS + "; add part specific to XTrackCAD installation + !include \\\"${NATIVE_CURRENT_SOURCE_DIR}\\\\install.nsh\\\"") + +SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS + "; add part specific to XTrackCAD uninstall + !include \\\"${NATIVE_CURRENT_SOURCE_DIR}\\\\uninstall.nsh\\\"") + +INCLUDE(CPack) + diff --git a/distribution/win32/nsis/headerimage.bmp b/distribution/win32/nsis/headerimage.bmp new file mode 100755 index 0000000..0644c5a Binary files /dev/null and b/distribution/win32/nsis/headerimage.bmp differ diff --git a/distribution/win32/nsis/install.nsh b/distribution/win32/nsis/install.nsh new file mode 100644 index 0000000..9f14625 --- /dev/null +++ b/distribution/win32/nsis/install.nsh @@ -0,0 +1,28 @@ +; +; This file is included from the CMake generated NSIS file during install. +; + +CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\XTrkCad Help.lnk" "$INSTDIR\share\xtrkcad\xtrkcad.chm" "" "" 0 +CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\XTrkCad ReadMe.lnk" "notepad.exe" "$INSTDIR\share\xtrkcad\ReadMe.txt" + +; +; create file association +; +; back up old value of .xtc + !define Index "Line${__LINE__}" + ReadRegStr $1 HKCR ".xtc" "" + StrCmp $1 "" "${Index}-NoBackup" + StrCmp $1 "XTrackCAD.Design" "${Index}-NoBackup" + WriteRegStr HKCR ".xtc" "backup_val" $1 + "${Index}-NoBackup:" + +; create the new association + WriteRegStr HKCR ".xtc" "" "XTrackCAD.Design" + WriteRegStr HKCR "XTrackCAD.Design" "" "XTrackCAD Layout Design" + WriteRegStr HKCR "XTrackCAD.Design\shell" "" "open" + WriteRegStr HKCR "XTrackCAD.Design\DefaultIcon" "" "$INSTDIR\bin\xtrkcad.exe,0" + WriteRegStr HKCR "XTrackCAD.Design\shell\open\command" "" '$INSTDIR\bin\xtrkcad.exe "%1"' + + System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' + + !undef Index \ No newline at end of file diff --git a/distribution/win32/nsis/uninstall.nsh b/distribution/win32/nsis/uninstall.nsh new file mode 100644 index 0000000..b568e21 --- /dev/null +++ b/distribution/win32/nsis/uninstall.nsh @@ -0,0 +1,30 @@ +; +; additional uninstaller instructions +; + +; Remove file association + !define Index "Line${__LINE__}" + ReadRegStr $1 HKCR ".xtc" "" + StrCmp $1 "XTrackCAD.Design" 0 "${Index}-NoOwn" ; only do this if we own it + ReadRegStr $1 HKCR ".xtc" "backup_val" + StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key + DeleteRegKey HKCR ".xtc" + Goto "${Index}-NoOwn" + "${Index}-Restore:" + WriteRegStr HKCR ".xtc" "" $1 + DeleteRegValue HKCR ".xtc" "backup_val" + + DeleteRegKey HKCR "XTrackCAD.Design" ;Delete key with association settings + + System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' + "${Index}-NoOwn:" + !undef Index + +; Remove shortcuts, if any +; SetShellVarContext all + +!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + +Delete "$SMPROGRAMS\$MUI_TEMP\XTrkCad Help.lnk" +Delete "$SMPROGRAMS\$MUI_TEMP\XTrkCad ReadMe.lnk" + \ No newline at end of file -- cgit v1.2.3