-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.iss
More file actions
79 lines (72 loc) · 2.21 KB
/
make.iss
File metadata and controls
79 lines (72 loc) · 2.21 KB
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
; Instalador para DocumentorJS
; Se requiere NODEJS instalado
; Compilar con Inno Setup: http://www.jrsoftware.org/isinfo.php
; @author Daniel Vera Morales
#define MyAppName "documentorjs"
#define MyAppAlias "documentorjs"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "Daniel Morales"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{108A82E0-0329-4CD5-9C5E-88C5E552D48A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\documentorjs
DisableDirPage=yes
DefaultGroupName=documentorjs
DisableProgramGroupPage=yes
InfoBeforeFile=./license.txt
OutputBaseFilename={#MyAppAlias}-{#MyAppVersion}
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
OutputDir=./dist/
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "./*"; Excludes:"./node_modules/*, ./Output"; AfterInstall:InstallNodeApp; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[code]
function InitializeUninstall(): Boolean;
var
C, P, D: String;
var R: Integer;
begin
C:= 'npm';
P:= 'uninstall --silent ';
D:= ExpandConstant('{app}');
if ShellExec('', C, P, D, SW_HIDE, ewWaitUntilTerminated, R) then begin
Result := True;
end
Result := False;
end;
function InitializeSetup(): boolean;
var
D: String;
R, ResultCode: integer;
begin
D:= '';
if ShellExec('', 'npm', '--version', D, SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
Result := True;
end
else begin
MsgBox('NODE JS IS NOT INSTALLED:>https://nodejs.org/en/download/package-manager/#windows', mbError, MB_OK)
ShellExec('open', 'https://nodejs.org/en/download/package-manager/#windows', '', '', SW_SHOW, ewNoWait, ResultCode);
Result := False;
end;
end;
procedure InstallNodeApp;
var
C, P, D: String;
var R: Integer;
begin
C:= 'npm';
P:= 'install --silent ';
D:= ExpandConstant('{app}');
ShellExec('', C, P, D, SW_HIDE, ewWaitUntilTerminated, R);
ShellExec('', C, 'link', D, SW_HIDE, ewWaitUntilTerminated, R);
end;