1+ param (
2+ [ValidateSet (" CPU" , " GPU" )]
3+ [Parameter (Mandatory = $true )]
4+ [string ]$Platform ,
5+
6+ [Parameter (Mandatory = $true )]
7+ [string ]$Version
8+ )
9+
10+ $ErrorActionPreference = " Stop"
11+
12+ $setup_script = " #include "" environment.iss"" "
13+ $setup_script += " `n #define MyAppName "" DeepStack"" "
14+ $setup_script += " `n #define MyAppVersion "" $Version "" "
15+ $setup_script += " `n #define MyAppPublisher "" DeepQuestAI"" "
16+ $setup_script += " `n #define MyAppURL "" https://www.deepstack.cc"" "
17+ $setup_script += " `n #define MyAppExeName "" deepstack.exe"" "
18+ $setup_script += " `n #define MyAppIcon "" logo.ico"" "
19+
20+ $setup_script += " `n`n [Setup]"
21+ $setup_script += " `n ChangesEnvironment=true"
22+ $setup_script += " `n AppId={{0E2C3125-3440-4622-A82A-3B1E07310EF2}"
23+ $setup_script += " `n AppName={#MyAppName}"
24+ $setup_script += " `n AppVersion={#MyAppVersion}"
25+ $setup_script += " `n AppPublisher={#MyAppPublisher}"
26+ $setup_script += " `n AppPublisherURL={#MyAppURL}"
27+ $setup_script += " `n AppSupportURL={#MyAppURL}"
28+ $setup_script += " `n AppUpdatesURL={#MyAppURL}"
29+ $setup_script += " `n DefaultDirName=C:\{#MyAppName}"
30+ $setup_script += " `n DisableDirPage=yes"
31+ $setup_script += " `n DefaultGroupName=DeepStack"
32+ $setup_script += " `n OutputBaseFilename=DeepStack-Installer-$Platform "
33+ $setup_script += " `n Compression=lzma"
34+ $setup_script += " `n SolidCompression=yes"
35+
36+ $setup_script += " `n`n [Languages]"
37+ $setup_script += " `n Name: "" english"" ; MessagesFile: "" compiler:Default.isl"" "
38+ $setup_script += " `n Name: "" armenian"" ; MessagesFile: "" compiler:Languages\Armenian.isl"" "
39+ $setup_script += " `n Name: "" brazilianportuguese"" ; MessagesFile: "" compiler:Languages\BrazilianPortuguese.isl"" "
40+ $setup_script += " `n Name: "" catalan"" ; MessagesFile: "" compiler:Languages\Catalan.isl"" "
41+ $setup_script += " `n Name: "" corsican"" ; MessagesFile: "" compiler:Languages\Corsican.isl"" "
42+ $setup_script += " `n Name: "" czech"" ; MessagesFile: "" compiler:Languages\Czech.isl"" "
43+ $setup_script += " `n Name: "" danish"" ; MessagesFile: "" compiler:Languages\Danish.isl"" "
44+ $setup_script += " `n Name: "" dutch"" ; MessagesFile: "" compiler:Languages\Dutch.isl"" "
45+ $setup_script += " `n Name: "" finnish"" ; MessagesFile: "" compiler:Languages\Finnish.isl"" "
46+ $setup_script += " `n Name: "" french"" ; MessagesFile: "" compiler:Languages\French.isl"" "
47+ $setup_script += " `n Name: "" german"" ; MessagesFile: "" compiler:Languages\German.isl"" "
48+ $setup_script += " `n Name: "" hebrew"" ; MessagesFile: "" compiler:Languages\Hebrew.isl"" "
49+ $setup_script += " `n Name: "" icelandic"" ; MessagesFile: "" compiler:Languages\Icelandic.isl"" "
50+ $setup_script += " `n Name: "" italian"" ; MessagesFile: "" compiler:Languages\Italian.isl"" "
51+ $setup_script += " `n Name: "" japanese"" ; MessagesFile: "" compiler:Languages\Japanese.isl"" "
52+ $setup_script += " `n Name: "" norwegian"" ; MessagesFile: "" compiler:Languages\Norwegian.isl"" "
53+ $setup_script += " `n Name: "" polish"" ; MessagesFile: "" compiler:Languages\Polish.isl"" "
54+ $setup_script += " `n Name: "" portuguese"" ; MessagesFile: "" compiler:Languages\Portuguese.isl"" "
55+ $setup_script += " `n Name: "" russian"" ; MessagesFile: "" compiler:Languages\Russian.isl"" "
56+ $setup_script += " `n Name: "" slovak"" ; MessagesFile: "" compiler:Languages\Slovak.isl"" "
57+ $setup_script += " `n Name: "" slovenian"" ; MessagesFile: "" compiler:Languages\Slovenian.isl"" "
58+ $setup_script += " `n Name: "" spanish"" ; MessagesFile: "" compiler:Languages\Spanish.isl"" "
59+ $setup_script += " `n Name: "" turkish"" ; MessagesFile: "" compiler:Languages\Turkish.isl"" "
60+ $setup_script += " `n Name: "" ukrainian"" ; MessagesFile: "" compiler:Languages\Ukrainian.isl"" "
61+
62+
63+ $setup_script += " `n`n [Tasks]"
64+ $setup_script += " `n Name: "" desktopicon"" ; Description: "" {cm:CreateDesktopIcon}"" ; GroupDescription: "" {cm:AdditionalIcons}"" ; Flags: unchecked"
65+ $setup_script += " `n Name: "" quicklaunchicon"" ; Description: "" {cm:CreateQuickLaunchIcon}"" ; GroupDescription: "" {cm:AdditionalIcons}"" ; Flags: unchecked; OnlyBelowVersion: 0,6.1"
66+
67+ $setup_script += " `n`n [Files]"
68+ $setup_script += " `n Source: "" $PSScriptRoot \server\deepstack.exe"" ; DestDir: "" {app}"" ; Flags: ignoreversion"
69+ $setup_script += " `n Source: "" $PSScriptRoot \*"" ; DestDir: "" {app}"" ;"
70+ $setup_script += " `n Source: "" $PSScriptRoot \intelligencelayer\*"" ; DestDir: "" {app}\intelligencelayer"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
71+ $setup_script += " `n Source: "" $PSScriptRoot \interpreter\*"" ; DestDir: "" {app}\interpreter"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
72+ $setup_script += " `n Source: "" $PSScriptRoot \redis\*"" ; DestDir: "" {app}\redis"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
73+ $setup_script += " `n Source: "" $PSScriptRoot \server\*"" ; DestDir: "" {app}\server"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
74+ if ($Platform -eq " CPU" ){
75+ $setup_script += " `n Source: "" $PSScriptRoot \platform\platform.windows.cpu.json"" ; DestDir: "" {app}\server"" ; DestName: "" platform.json"" ; Flags: ignoreversion"
76+ }
77+ elseif ($Platform -eq " GPU" ) {
78+ $setup_script += " `n Source: "" $PSScriptRoot \platform\platform.windows.gpu.json"" ; DestDir: "" {app}\server"" ; DestName: "" platform.json"" ; Flags: ignoreversion"
79+ }
80+ $setup_script += " `n Source: "" $PSScriptRoot \server\version.txt"" ; DestDir: "" {app}\server"" ; Flags: ignoreversion"
81+ $setup_script += " `n Source: "" $PSScriptRoot \sharedfiles\categories_places365.txt"" ; DestDir: "" {app}\sharedfiles"" ; Flags: ignoreversion"
82+ $setup_script += " `n Source: "" $PSScriptRoot \sharedfiles\face.pt"" ; DestDir: "" {app}\sharedfiles"" ; Flags: ignoreversion"
83+ $setup_script += " `n Source: "" $PSScriptRoot \sharedfiles\facerec-high.model"" ; DestDir: "" {app}\sharedfiles"" ; Flags: ignoreversion"
84+ $setup_script += " `n Source: "" $PSScriptRoot \sharedfiles\scene.pt"" ; DestDir: "" {app}\sharedfiles"" ; Flags: ignoreversion"
85+ $setup_script += " `n Source: "" $PSScriptRoot \sharedfiles\yolov5m.pt"" ; DestDir: "" {app}\sharedfiles"" ; Flags: ignoreversion"
86+ if ($Platform -eq " CPU" ){
87+ $setup_script += " `n Source: "" $PSScriptRoot \windows_packages_cpu\*"" ; DestDir: "" {app}\windows_packages"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
88+ }
89+ elseif ($Platform -eq " GPU" ){
90+ $setup_script += " `n Source: "" $PSScriptRoot \windows_packages_gpu\*"" ; DestDir: "" {app}\windows_packages"" ; Flags: ignoreversion recursesubdirs createallsubdirs"
91+ }
92+
93+ $setup_script += " `n Source: "" $PSScriptRoot \logo.ico"" ; DestDir: "" {app}"" ; Flags: ignoreversion"
94+ $setup_script += " `n Source: "" $PSScriptRoot \init.py"" ; DestDir: "" {app}"" ; Flags: ignoreversion"
95+
96+ $setup_script += " `n`n [Icons]"
97+ $setup_script += " `n Name: "" {group}\{#MyAppName}"" ; Filename: "" {app}\{#MyAppExeName}"" "
98+ $setup_script += " `n Name: "" {group}\{cm:UninstallProgram,{#MyAppName}}"" ; Filename: "" {uninstallexe}"" "
99+ $setup_script += " `n Name: "" {commondesktop}\{#MyAppName}"" ; Filename: "" {app}\{#MyAppExeName}"" ; IconFilename: {app}\{#MyAppIcon}; Tasks: desktopicon quicklaunchicon"
100+ $setup_script += " `n Name: "" {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"" ; Filename: "" {app}\{#MyAppExeName}"" ; IconFilename: {app}\{#MyAppIcon}; Tasks: quicklaunchicon"
101+
102+ $setup_script += " `n [Code]"
103+ $setup_script += " `n procedure CurStepChanged(CurStep: TSetupStep);"
104+ $setup_script += " `n begin"
105+ $setup_script += " `n if CurStep = ssPostInstall"
106+ $setup_script += " `n then EnvAddPath(ExpandConstant('{app}') + '\server');"
107+ $setup_script += " `n end;"
108+
109+ $setup_script += " `n`n procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);"
110+ $setup_script += " `n begin"
111+ $setup_script += " `n if CurUninstallStep = usPostUninstall"
112+ $setup_script += " `n then EnvRemovePath(ExpandConstant('{app}' + '\server'));"
113+ $setup_script += " `n end;"
114+
115+ Set-Content - Path " deepstack-windows.iss" - Value $setup_script
0 commit comments