summaryrefslogtreecommitdiff
path: root/distribution/win32/nsis/install.nsh
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
commit7b358424ebad9349421acd533c2fa1cbf6cf3e3e (patch)
tree686678532eefed525c242fd214d0cfb2914726c5 /distribution/win32/nsis/install.nsh
Initial import of xtrkcad version 1:4.0.2-2
Diffstat (limited to 'distribution/win32/nsis/install.nsh')
-rw-r--r--distribution/win32/nsis/install.nsh28
1 files changed, 28 insertions, 0 deletions
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