-
Notifications
You must be signed in to change notification settings - Fork 1
/
Setup.nsi
77 lines (52 loc) · 1.92 KB
/
Setup.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
; This script shows how to make your applicaton uninstallable
;--------------------------------
; The name of the installer
Name "UninstallExample1"
; The file to write
OutFile "Tesseract_GUI_Tool.exe"
; The default installation directory
InstallDir $PROGRAMFILES\Tesseract_GUI\
; The text to prompt the user to enter a directory
DirText "This will install My Cool Program on your computer. Choose a directory"
;--------------------------------
; The stuff to install
Section -Prerequisites
SetOutPath $INSTDIR\Prerequisites
MessageBox MB_YESNO "Install Python?" /SD IDYES IDNO endPython
File "py3.8.0.exe"
ExecWait "$INSTDIR\Prerequisites\py3.8.0.exe"
endPython:
MessageBox MB_YESNO "Install GhostScript?" /SD IDYES IDNO endGS
File "gs.exe"
ExecWait "$INSTDIR\Prerequisites\gs.exe"
endGS:
MessageBox MB_YESNO "Install Tesseract?" /SD IDYES IDNO endTess
File "tesseractsetup.exe"
ExecWait "$INSTDIR\Prerequisites\tesseractsetup.exe"
endTess:
MessageBox MB_YESNO "Add Environment Variables?" /SD IDYES IDNO endENV
ExecWait 'setx path "%path%;%localappdata%\Programs\Python\Python38-32\Scripts;C:\Program Files\Tesseract-OCR;%localappdata%\Programs\Python\Python38-32"'
endENV:
MessageBox MB_YESNO "Install PyPDF2?" /SD IDYES IDNO endPyPDF2
ExecWait "pip install PyPDF2"
endPypdf2:
SectionEnd
Section ""
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put a file there
File Tesseract_GUI_Tool.exe
; Tell the compiler to write an uninstaller and to look for a "Uninstall" section
WriteUninstaller $INSTDIR\Uninstall.exe
SectionEnd
Section "Desktop Shortcut" SectionX
SetShellVarContext current
CreateShortCut "$DESKTOP\Tesseract_GUI_Tool.lnk" "$INSTDIR\Tesseract_GUI_Tool.exe"
SectionEnd
;-------------------
; The uninstall section
Section "Uninstall"
Delete $INSTDIR\Uninstall_Tesseract_GUIl.exe
Delete $INSTDIR\Tesseract_GUI_Tool.exe
RMDir $INSTDIR
SectionEnd