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/CMakeLists.txt | 29 +++++++++++++ distribution/osx/CMakeLists.txt | 55 +++++++++++++++++++++++++ distribution/osx/bundle/CMakeLists.txt | 13 ++++++ distribution/osx/bundle/Info.plist.in | 16 +++++++ distribution/osx/bundle/volume.icns | Bin 0 -> 50316 bytes distribution/osx/bundle/volume.png | Bin 0 -> 21056 bytes distribution/osx/bundle/volume.xcf | Bin 0 -> 51420 bytes distribution/osx/bundle/xtrackcad-startup | 43 +++++++++++++++++++ distribution/osx/dependencies.cmake.in | 9 ++++ distribution/osx/yosemite-fix/libiconv.2.dylib | Bin 0 -> 944420 bytes distribution/osx/yosemite-fix/libxml2.2.dylib | Bin 0 -> 2381112 bytes distribution/osx/yosemite-fix/libz.1.dylib | Bin 0 -> 169312 bytes distribution/posix/CMakeLists.txt | 20 +++++++++ distribution/posix/CMakeListsSTGZ.txt | 9 ++++ distribution/posix/changelog.txt | 2 + distribution/posix/xtrkcad-desc.txt | 11 +++++ distribution/posix/xtrkcad.spec | 42 +++++++++++++++++++ distribution/posix/xtrkcad_4.2.1.debian.tar.gz | Bin 0 -> 11905 bytes distribution/posix/xtrkcad_4.2.1.dsc | 20 +++++++++ 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 ++++++++++++++ 24 files changed, 348 insertions(+) create mode 100644 distribution/CMakeLists.txt create mode 100644 distribution/osx/CMakeLists.txt create mode 100644 distribution/osx/bundle/CMakeLists.txt create mode 100644 distribution/osx/bundle/Info.plist.in create mode 100644 distribution/osx/bundle/volume.icns create mode 100644 distribution/osx/bundle/volume.png create mode 100644 distribution/osx/bundle/volume.xcf create mode 100644 distribution/osx/bundle/xtrackcad-startup create mode 100644 distribution/osx/dependencies.cmake.in create mode 100644 distribution/osx/yosemite-fix/libiconv.2.dylib create mode 100644 distribution/osx/yosemite-fix/libxml2.2.dylib create mode 100644 distribution/osx/yosemite-fix/libz.1.dylib create mode 100644 distribution/posix/CMakeLists.txt create mode 100644 distribution/posix/CMakeListsSTGZ.txt create mode 100644 distribution/posix/changelog.txt create mode 100644 distribution/posix/xtrkcad-desc.txt create mode 100644 distribution/posix/xtrkcad.spec create mode 100644 distribution/posix/xtrkcad_4.2.1.debian.tar.gz create mode 100644 distribution/posix/xtrkcad_4.2.1.dsc 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') diff --git a/distribution/CMakeLists.txt b/distribution/CMakeLists.txt new file mode 100644 index 0000000..e97a4a4 --- /dev/null +++ b/distribution/CMakeLists.txt @@ -0,0 +1,29 @@ +# Setup global packaging parameters ... +SET(CPACK_PACKAGE_DESCRIPTION "XTrackCad is a CAD program for designing model railroad layouts.") +SET(CPACK_PACKAGE_EXECUTABLES "xtrkcad;XTrkCAD ${XTRKCAD_VERSION}") +SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "XTrkCAD ${XTRKCAD_VERSION}") +SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "XTrkCAD ${XTRKCAD_VERSION}") +SET(CPACK_PACKAGE_NAME "xtrkcad") +SET(CPACK_PACKAGE_VENDOR "http://www.xtrkcad.org") +SET(CPACK_PACKAGE_VERSION ${XTRKCAD_VERSION}) +SET(CPACK_PACKAGE_VERSION_MAJOR ${XTRKCAD_MAJOR_VERSION}) +SET(CPACK_PACKAGE_VERSION_MINOR ${XTRKCAD_MINOR_VERSION}) +SET(CPACK_PACKAGE_VERSION_PATCH ${XTRKCAD_RELEASE_VERSION}) +SET(CPACK_RESOURCE_FILE_LICENSE "${XTrkCAD_SOURCE_DIR}/app/COPYING") +SET(CPACK_SOURCE_GENERATOR "ZIP;TGZ") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "xtrkcad-source-${XTRKCAD_VERSION}") + +# Setup platform-specific packaging ... +IF(APPLE) + ADD_SUBDIRECTORY(osx) +ENDIF(APPLE) + +IF(UNIX AND NOT APPLE) + ADD_SUBDIRECTORY(posix) +ENDIF(UNIX AND NOT APPLE) + +IF(WIN32) + ADD_SUBDIRECTORY(win32) +ENDIF(WIN32) + diff --git a/distribution/osx/CMakeLists.txt b/distribution/osx/CMakeLists.txt new file mode 100644 index 0000000..5269250 --- /dev/null +++ b/distribution/osx/CMakeLists.txt @@ -0,0 +1,55 @@ +# Automatically generate most of our external dependencies ... +GET_TARGET_PROPERTY(XTRKCAD_LOCATION xtrkcad LOCATION) +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake" @ONLY) +INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake") + +# Handle some external dependencies that can't be detected automatically ... +SET(MACPORTS_DIR "/opt/local" CACHE PATH "Root directory containing installed MacPort packages") +MARK_AS_ADVANCED(MACPORTS_DIR) + +INSTALL(DIRECTORY + ${MACPORTS_DIR}/lib/gtk-2.0 + DESTINATION lib + USE_SOURCE_PERMISSIONS + ) + +INSTALL(DIRECTORY + ${MACPORTS_DIR}/etc/gtk-2.0 + DESTINATION etc + USE_SOURCE_PERMISSIONS + ) + +INSTALL(DIRECTORY + ${MACPORTS_DIR}/lib/pango + DESTINATION lib + USE_SOURCE_PERMISSIONS + ) + +INSTALL(DIRECTORY + ${MACPORTS_DIR}/lib/gdk-pixbuf-2.0 + DESTINATION lib + USE_SOURCE_PERMISSIONS + ) + +INSTALL(FILES + ${MACPORTS_DIR}/etc/pango/pangorc + ${MACPORTS_DIR}/etc/pango/pango.modules + DESTINATION etc/pango + ) + +INSTALL(FILES + ${MACPORTS_DIR}/etc/fonts/fonts.conf + ${MACPORTS_DIR}/etc/fonts/fonts.dtd + DESTINATION etc/fonts + ) + +INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libxml2.2.dylib + ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libz.1.dylib + ${CMAKE_CURRENT_SOURCE_DIR}/yosemite-fix/libiconv.2.dylib + DESTINATION lib +) + +# Generate bundles ... +ADD_SUBDIRECTORY(bundle) + diff --git a/distribution/osx/bundle/CMakeLists.txt b/distribution/osx/bundle/CMakeLists.txt new file mode 100644 index 0000000..65f30dd --- /dev/null +++ b/distribution/osx/bundle/CMakeLists.txt @@ -0,0 +1,13 @@ +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) + +SET(CPACK_GENERATOR "Bundle") +SET(CPACK_BUNDLE_ICON "${XTrkCAD_SOURCE_DIR}/app/lib/icon.icns") +SET(CPACK_BUNDLE_NAME "XTrackCAD") +SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") +SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/xtrackcad-startup") +SET(CPACK_INSTALL_CMAKE_PROJECTS "${XTrkCAD_BINARY_DIR};xtrkcad;ALL;/") +SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}-${CMAKE_SYSTEM_PROCESSOR}") +SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/volume.icns") + +INCLUDE(CPack) + diff --git a/distribution/osx/bundle/Info.plist.in b/distribution/osx/bundle/Info.plist.in new file mode 100644 index 0000000..ba946ee --- /dev/null +++ b/distribution/osx/bundle/Info.plist.in @@ -0,0 +1,16 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + XTrackCAD + CFBundleGetInfoString + @XTRKCAD_VERSION@ + CFBundleIconFile + XTrackCAD + LSMinimumSystemVersion + 10.5 + + diff --git a/distribution/osx/bundle/volume.icns b/distribution/osx/bundle/volume.icns new file mode 100644 index 0000000..12850fb Binary files /dev/null and b/distribution/osx/bundle/volume.icns differ diff --git a/distribution/osx/bundle/volume.png b/distribution/osx/bundle/volume.png new file mode 100644 index 0000000..a1ea62a Binary files /dev/null and b/distribution/osx/bundle/volume.png differ diff --git a/distribution/osx/bundle/volume.xcf b/distribution/osx/bundle/volume.xcf new file mode 100644 index 0000000..45e3363 Binary files /dev/null and b/distribution/osx/bundle/volume.xcf differ diff --git a/distribution/osx/bundle/xtrackcad-startup b/distribution/osx/bundle/xtrackcad-startup new file mode 100644 index 0000000..e82d444 --- /dev/null +++ b/distribution/osx/bundle/xtrackcad-startup @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Author: Aaron Voisine +# Inkscape Modifications: Michael Wybrow +# XTrackCAD Modifications: Timothy M. Shead + +XTRKCAD_BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/XTrackCAD//'`" +XTRKCAD_RESOURCES="$XTRKCAD_BUNDLE/Contents/Resources" +XTRKCAD_TEMP="/tmp/xtrkcad/$UID" +XTRKCAD_ETC="$XTRKCAD_TEMP/etc" +XTRKCAD_GDK_PIXBUF_MODULE_FILE="$XTRKCAD_ETC/gtk-2.0/gdk-pixbuf.loaders" +XTRKCAD_GTK_IM_MODULE_FILE="$XTRKCAD_ETC/gtk-2.0/gtk.immodules" +XTRKCAD_PANGO_RC_FILE="$XTRKCAD_ETC/pango/pangorc" + +echo "XTrackCAD: Starting $0" +echo "XTrackCAD: XTRKCAD_BUNDLE: $XTRKCAD_BUNDLE" + +# Setup temporary runtime files +rm -rf "$XTRKCAD_TEMP" + +# Because the bundle could be located anywhere at runtime, we have to +# create temporary copies of the Pango configuration files that +# reflect our current location +mkdir -p "$XTRKCAD_ETC/gtk-2.0" +sed -e 's|/opt/local|'"$XTRKCAD_RESOURCES|g" "$XTRKCAD_RESOURCES/etc/gtk-2.0/gdk-pixbuf.loaders" > "$XTRKCAD_GDK_PIXBUF_MODULE_FILE" +sed -e 's|/opt/local|'"$XTRKCAD_RESOURCES|g" "$XTRKCAD_RESOURCES/etc/gtk-2.0/gtk.immodules" > "$XTRKCAD_GTK_IM_MODULE_FILE" +mkdir -p "$XTRKCAD_ETC/pango" +sed -e 's|/opt/local/etc|'"$XTRKCAD_ETC|g" "$XTRKCAD_RESOURCES/etc/pango/pangorc" > "$XTRKCAD_ETC/pango/pangorc" +sed -e 's|/opt/local|\"'"$XTRKCAD_RESOURCES|g" -e "s/\.so/.so\"/g" "$XTRKCAD_RESOURCES/etc/pango/pango.modules" > "$XTRKCAD_ETC/pango/pango.modules" + +export "DYLD_LIBRARY_PATH=$XTRKCAD_RESOURCES/lib" +export "FONTCONFIG_PATH=$XTRKCAD_RESOURCES/etc/fonts" +export "GDK_PIXBUF_MODULE_FILE=$XTRKCAD_GDK_PIXBUF_MODULE_FILE" +export "GTK_IM_MODULE_FILE=$XTRKCAD_GTK_IM_MODULE_FILE" +export "PANGO_RC_FILE=$XTRKCAD_PANGO_RC_FILE" +export "PATH=$XTRKCAD_RESOURCES/bin:$PATH" +export "XTRKCADLIB=$XTRKCAD_RESOURCES/share/xtrkcad" + +export +exec "$XTRKCAD_RESOURCES/bin/xtrkcad" + +echo "XTrackCAD: Finishing $0" + diff --git a/distribution/osx/dependencies.cmake.in b/distribution/osx/dependencies.cmake.in new file mode 100644 index 0000000..dfa3221 --- /dev/null +++ b/distribution/osx/dependencies.cmake.in @@ -0,0 +1,9 @@ +INCLUDE(GetPrerequisites) +GET_PREREQUISITES(@XTRKCAD_LOCATION@ DEPENDENCIES 1 1 "" "") + +FOREACH(DEPENDENCY ${DEPENDENCIES}) + GET_FILENAME_COMPONENT(DEPENDENCY_NAME "${DEPENDENCY}" NAME) + GET_FILENAME_COMPONENT(DEPENDENCY_ACTUAL "${DEPENDENCY}" REALPATH) + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE PROGRAM RENAME "${DEPENDENCY_NAME}" FILES "${DEPENDENCY_ACTUAL}") +ENDFOREACH() + diff --git a/distribution/osx/yosemite-fix/libiconv.2.dylib b/distribution/osx/yosemite-fix/libiconv.2.dylib new file mode 100644 index 0000000..ef12b3a Binary files /dev/null and b/distribution/osx/yosemite-fix/libiconv.2.dylib differ diff --git a/distribution/osx/yosemite-fix/libxml2.2.dylib b/distribution/osx/yosemite-fix/libxml2.2.dylib new file mode 100644 index 0000000..4dbea97 Binary files /dev/null and b/distribution/osx/yosemite-fix/libxml2.2.dylib differ diff --git a/distribution/osx/yosemite-fix/libz.1.dylib b/distribution/osx/yosemite-fix/libz.1.dylib new file mode 100644 index 0000000..5abd84b Binary files /dev/null and b/distribution/osx/yosemite-fix/libz.1.dylib differ diff --git a/distribution/posix/CMakeLists.txt b/distribution/posix/CMakeLists.txt new file mode 100644 index 0000000..daa89cf --- /dev/null +++ b/distribution/posix/CMakeLists.txt @@ -0,0 +1,20 @@ +# Setup packaging ... +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "XTrackCAD is a CAD program for designing model railroad layouts.") +SET(CPACK_GENERATOR "TGZ" "RPM" "TBZ2") +SET(CPACK_PACKAGE_RELEASE 1) +SET(CPACK_RPM_PACKAGE_LICENSE "GPL") +SET(CPACK_RPM_PACKAGE_GROUP "Applications/Engineering") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}////xtrkcad-desc.txt") +SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}") +SET(CPACK_INSTALL_PREFIX "/usr/local/" ) +SET(CPACK_PACKAGE_VENDOR "XTrackCAD Fork Project") +SET(CPACK_RPM_PACKAGE_REQUIRES "glibc gtk2 webkitgtk") +# exclude these directories from the rpm +SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/locale" + "/usr/share/locale/*" +) + +SET(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}////changelog.txt") + +INCLUDE(CPack) + diff --git a/distribution/posix/CMakeListsSTGZ.txt b/distribution/posix/CMakeListsSTGZ.txt new file mode 100644 index 0000000..f056462 --- /dev/null +++ b/distribution/posix/CMakeListsSTGZ.txt @@ -0,0 +1,9 @@ +# Setup packaging ... +SET(CPACK_GENERATOR "STGZ") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}////xtrkcad-desc.txt") +SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}") +SET(CPACK_SET_DESTDIR "") +SET(CPACK_INSTALL_PREFIX "" ) + +INCLUDE(CPack) + diff --git a/distribution/posix/changelog.txt b/distribution/posix/changelog.txt new file mode 100644 index 0000000..0d6bcf4 --- /dev/null +++ b/distribution/posix/changelog.txt @@ -0,0 +1,2 @@ +* Wed Jun 10 2015 Martin Fischer +- Initial RPM build configuration \ No newline at end of file diff --git a/distribution/posix/xtrkcad-desc.txt b/distribution/posix/xtrkcad-desc.txt new file mode 100644 index 0000000..516d70b --- /dev/null +++ b/distribution/posix/xtrkcad-desc.txt @@ -0,0 +1,11 @@ +XTrackCAD is a CAD program for designing Model Railroad layouts. +XTrackCAD supports any scale, has libraries of popular brands of x +turnouts and sectional track (plus you add your own easily), can +automatically use spiral transition curves when joining track +and has extensive on-line help and demonstrations. +XTrackCad lets you manipulate track much like you would with actual +flex-track to modify, extend and join tracks and turnouts. +Additional features include tunnels, 'post-it' notes, on-screen +ruler, parts list, 99 drawing layers, undo/redo commands, +benchwork, 'Print to BitMap', elevations, train simulation and +car inventory. diff --git a/distribution/posix/xtrkcad.spec b/distribution/posix/xtrkcad.spec new file mode 100644 index 0000000..4f5e72e --- /dev/null +++ b/distribution/posix/xtrkcad.spec @@ -0,0 +1,42 @@ +Summary: XTrkCad +Name: xtrkcad +Version: 4.2.1 +Release: 1%{?dist} +License: GPL +Group: Applications/Engineering +Vendor: XTrkCad Fork Project +Source: xtrkcad-source-%{version}.tar.gz +BuildRoot: /var/tmp/%{name}-root +BuildRequires: gcc, cmake >= 2.4.7, pkgconfig, gtk2-devel, webkitgtk-devel +BuildRequires: gettext, gettext-devel, glibc-devel +%description +XTrkCad is a CAD program for designing Model Railroad layouts. +XTrkCad supports any scale, has libraries of popular brands of x +turnouts and sectional track (plus you add your own easily), can +automatically use spiral transition curves when joining track +XTrkCad lets you manipulate track much like you would with actual +flex-track to modify, extend and join tracks and turnouts. +Additional features include tunnels, 'post-it' notes, on-screen +ruler, parts list, 99 drawing layers, undo/redo commands, +benchwork, 'Print to BitMap', elevations, train simulation and +car inventory. + +%prep +%setup -n xtrkcad-source-%{version} -q + +%build +cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr/ . +make + +%install +rm -rf $RPM_BUILD_ROOT/* +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) +%{_bindir}/xtrkcad +%{_datadir} + diff --git a/distribution/posix/xtrkcad_4.2.1.debian.tar.gz b/distribution/posix/xtrkcad_4.2.1.debian.tar.gz new file mode 100644 index 0000000..c1a8721 Binary files /dev/null and b/distribution/posix/xtrkcad_4.2.1.debian.tar.gz differ diff --git a/distribution/posix/xtrkcad_4.2.1.dsc b/distribution/posix/xtrkcad_4.2.1.dsc new file mode 100644 index 0000000..619202c --- /dev/null +++ b/distribution/posix/xtrkcad_4.2.1.dsc @@ -0,0 +1,20 @@ +Format: 3.0 (quilt) +Source: xtrkcad +Binary: xtrkcad +Architecture: any +Version: 4.2.1 +Maintainer: Robert Heller +Homepage: http://sourceforge.net/projects/xtrkcad-fork/ +Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 8.0.0), cmake (>= 2.4.7), pkg-config, libgtk2.0-dev, libwebkitgtk-dev, gcc, gettext +Package-List: + xtrkcad deb unknown extra +Checksums-Sha1: + e22e10a00c62905e55576ceb29be0156bf0e1a72 6877531 xtrkcad_4.2.1.orig.tar.gz + 3af638aa1080a3466a78256087a07a4de0435148 11905 xtrkcad_4.2.1.debian.tar.gz +Checksums-Sha256: + ffb344b738f3542678b7a4504045e46c0369d5f01c3237ad1fa0ca631b4f4af1 6877531 xtrkcad_4.2.1.orig.tar.gz + 2398c43a2b393870106861d00774fe3a754c08716762af6fbba82bbcdc669cbf 11905 xtrkcad_4.2.1.debian.tar.gz +Files: + df72e4ceb44faf5ff9399daee030199a 6877531 xtrkcad_4.2.1.orig.tar.gz + c2c5f9f6f6b10bc3f15e3ac48a71737a 11905 xtrkcad_4.2.1.debian.tar.gz 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