-
Notifications
You must be signed in to change notification settings - Fork 1
/
win_install.nsi
96 lines (66 loc) · 2.34 KB
/
win_install.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
;
; NSIS script to build FRCTools installer
;
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
!define APP_REG_ID "FRCTools"
!define APP_DESCRIPTION "FRC Tools for Fusion"
!define UNINSTALL_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_REG_ID}"
;--------------------------------
;General
;Name and file
Name "${APP_DESCRIPTION}"
OutFile "build/FRCTools-win.exe"
Unicode True
;Default installation folder
InstallDir "$APPDATA\Autodesk\Autodesk Fusion 360\API\AddIns\FRCTools"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${APP_REG_ID}" ""
;Request application privileges for Windows Vista
RequestExecutionLevel user
;--------------------------------
;Interface Configuration
!define MUI_ICON ".\docs\icons\installer.ico"
!define MUI_UNICON ".\docs\icons\installer.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\docs\icons\CCDistance.bmp" ; optional
!define MUI_HEADERIMAGE_BITMAP_STRETCH "AspectFitHeight"
!define MUI_HEADERIMAGE_UNBITMAP ".\docs\icons\CCDistance.bmp" ; optional
!define MUI_HEADERIMAGE_UNBITMAP_STRETCH "AspectFitHeight"
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Add in" SecAddIn
SetOutPath "$INSTDIR"
File FRCTools.py
File FRCTools.Manifest
File config.py
File /r /x __pycache__ /x *.pyc commands
File /r /x __pycache__ /x *.pyc lib
;Store installation folder
WriteRegStr HKCU "Software\${APP_REG_ID}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKCU ${UNINSTALL_REG_KEY} "" ""
WriteRegStr HKCU ${UNINSTALL_REG_KEY} "DisplayName" "${APP_DESCRIPTION}"
WriteRegStr HKCU ${UNINSTALL_REG_KEY} "UninstallString" '"$INSTDIR\Uninstall.exe"'
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\Uninstall.exe"
RMDir /r "$INSTDIR"
DeleteRegKey HKCU "Software\${APP_REG_ID}"
DeleteRegKey HKCU ${UNINSTALL_REG_KEY}
SectionEnd