1+ ; Script generated by the Inno Setup Script Wizard.
2+ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+ #define MyAppName " Direct Print Server"
5+ #define MyAppVersion " 1.0"
6+ #define MyAppPublisher " JSC Solvaig"
7+ #define MyAppURL " https://github.com/procks/direct_print_server"
8+
9+ [Setup]
10+ ; NOTE: The value of AppId uniquely identifies this application.
11+ ; Do not use the same AppId value in installers for other applications.
12+ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+ AppId = {{215ED57E-4DC9-40EA-85E2-4A326D2C0419}
14+ AppName = {#MyAppName }
15+ AppVersion = {#MyAppVersion}
16+ ;AppVerName={#MyAppName} {#MyAppVersion}
17+ AppPublisher = {#MyAppPublisher}
18+ AppPublisherURL = {#MyAppURL}
19+ AppSupportURL = {#MyAppURL}
20+ AppUpdatesURL = {#MyAppURL}
21+ DefaultDirName = {pf} \DirectPrintServer
22+ DefaultGroupName = {#MyAppName }
23+ DisableProgramGroupPage = yes
24+ OutputDir = Output
25+ OutputBaseFilename = DirectPrintServerSetup
26+ Compression = lzma
27+ SolidCompression = yes
28+
29+ [Languages]
30+ Name : " en" ; MessagesFile : " compiler:Default.isl"
31+ Name : " ru" ; MessagesFile : " compiler:Languages\Russian.isl"
32+ Name : " uk" ; MessagesFile : " compiler:Languages\Ukrainian.isl"
33+
34+ [CustomMessages]
35+ en .ServiceAccountInformation= Log on Service as :
36+ ru .ServiceAccountInformation= Çàïóñêàòü ñåðâèñ îò èìåíè:
37+ uk .ServiceAccountInformation= Log on Service as :
38+
39+ [Files]
40+ Source : " Files\prunsrv.exe" ; DestDir : " {app} " ; Flags : ignoreversion
41+ Source : " Files\gsdll32.dll" ; DestDir : " {app} " ; Flags : ignoreversion
42+ Source : " Files\gswin32c.exe" ; DestDir : " {app} " ; Flags : ignoreversion
43+ Source : " Files\install.cmd" ; DestDir : " {app} " ; Flags : ignoreversion
44+ Source : " Files\install_ex.cmd" ; DestDir : " {app} " ; Flags : ignoreversion
45+ Source : " Files\LICENSE.txt" ; DestDir : " {app} " ; Flags : ignoreversion
46+ Source : " Files\PrintServer.jar" ; DestDir : " {app} " ; Flags : ignoreversion
47+ Source : " Files\prunmgr.exe" ; DestDir : " {app} " ; Flags : ignoreversion
48+ Source : " Files\prunsrv.exe" ; DestDir : " {app} " ; Flags : ignoreversion
49+ Source : " Files\uninstall.cmd" ; DestDir : " {app} " ; Flags : ignoreversion
50+ ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
51+
52+ [Icons]
53+ Name : " {group} \{cm:UninstallProgram,{#MyAppName}}" ; Filename : " {uninstallexe} "
54+
55+ [Run]
56+ Filename : " {app} \install.cmd" ; Parameters : " {code:GetUserName} {code:GetPassword}" ; WorkingDir : " {app} " ; Flags : runhidden ; StatusMsg : " Installing service"
57+
58+ [UninstallRun]
59+ Filename : " {app} \uninstall.cmd" ; WorkingDir : " {app} " ; Flags : runhidden ; StatusMsg : " Uninstalling service"
60+
61+ [Code]
62+ var
63+ Page: TInputQueryWizardPage;
64+ LocalSystemAccountCheckBox: TNewCheckBox;
65+ LabelFolder: TLabel;
66+ // MainPage: TWizardPage;
67+ UserEdit: TNewEdit;
68+ PassEdit: TNewEdit;
69+ ConfPassEdit: TNewEdit;
70+ UserStaticText: TNewStaticText;
71+ PassStaticText: TNewStaticText;
72+ ConfPassStaticText: TNewStaticText;
73+
74+ procedure LocalSystemAccountCheckBoxOnClick (Sender: TObject);
75+ begin
76+ if LocalSystemAccountCheckBox.Checked then begin
77+ UserStaticText.Enabled := false;
78+ UserEdit.Enabled := false;
79+ PassStaticText.Enabled := false;
80+ PassEdit.Enabled := false;
81+ ConfPassStaticText.Enabled := false;
82+ ConfPassEdit.Enabled := false;
83+ end
84+ else begin
85+ UserStaticText.Enabled := true;
86+ UserEdit.Enabled := true;
87+ PassStaticText.Enabled := true;
88+ PassEdit.Enabled := true;
89+ ConfPassStaticText.Enabled := true;
90+ ConfPassEdit.Enabled := true;
91+ end ;
92+ end ;
93+
94+ procedure InitializeWizard ;
95+ begin
96+ Page := CreateInputQueryPage(wpWelcome, // wpSelectComponents,
97+ CustomMessage(' ServiceAccountInformation' ), ' Please enter account information' ,
98+ ' ' );
99+
100+ LocalSystemAccountCheckBox := TNewCheckBox.Create(Page);
101+ LocalSystemAccountCheckBox.Parent := Page.Surface;
102+ LocalSystemAccountCheckBox.Width := ScaleX(200 );
103+ LocalSystemAccountCheckBox.Caption := ' Local system account' ;
104+ LocalSystemAccountCheckBox.Checked := true;
105+ LocalSystemAccountCheckBox.OnClick := @LocalSystemAccountCheckBoxOnClick;
106+
107+ UserStaticText := TNewStaticText.Create(Page);
108+ UserStaticText.Top := LocalSystemAccountCheckBox.Top + LocalSystemAccountCheckBox.Height + ScaleY(12 );
109+ UserStaticText.Caption := ' User' ;
110+ UserStaticText.AutoSize := True;
111+ UserStaticText.Parent := Page.Surface;
112+ UserStaticText.Enabled := false;
113+
114+ UserEdit := TNewEdit.Create(Page);
115+ UserEdit.Parent := Page.Surface;
116+ UserEdit.Top := LocalSystemAccountCheckBox.Top + LocalSystemAccountCheckBox.Height + ScaleY(8 );
117+ UserEdit.Left := ScaleX(100 );
118+ UserEdit.Width := ScaleX(150 );
119+ UserEdit.Enabled := false;
120+
121+ PassStaticText := TNewStaticText.Create(Page);
122+ PassStaticText.Top := UserEdit.Top + UserEdit.Height + ScaleY(12 );
123+ PassStaticText.Caption := ' Password' ;
124+ PassStaticText.AutoSize := True;
125+ PassStaticText.Parent := Page.Surface;
126+ PassStaticText.Enabled := false;
127+
128+ PassEdit := TNewEdit.Create(Page);
129+ PassEdit.Parent := Page.Surface;
130+ PassEdit.Top := UserEdit.Top + UserEdit.Height + ScaleY(8 );
131+ PassEdit.Left := UserEdit.Left;
132+ PassEdit.Width := UserEdit.Width;
133+ PassEdit.PasswordChar := ' *' ;
134+ PassEdit.Enabled := false;
135+
136+ ConfPassStaticText := TNewStaticText.Create(Page);
137+ ConfPassStaticText.Top := PassEdit.Top + PassEdit.Height + ScaleY(12 );
138+ ConfPassStaticText.Caption := ' Confirm password' ;
139+ ConfPassStaticText.AutoSize := True;
140+ ConfPassStaticText.Parent := Page.Surface;
141+ ConfPassStaticText.Enabled := false;
142+
143+ ConfPassEdit := TNewEdit.Create(Page);
144+ ConfPassEdit.Parent := Page.Surface;
145+ ConfPassEdit.Top := PassEdit.Top + PassEdit.Height + ScaleY(8 );
146+ ConfPassEdit.Left := UserEdit.Left;
147+ ConfPassEdit.Width := UserEdit.Width;
148+ ConfPassEdit.PasswordChar := ' *' ;
149+ ConfPassEdit.Enabled := false;
150+ end ;
151+
152+ function NextButtonClick (CurPageID: Integer): Boolean;
153+ var
154+ ResultCode: Integer;
155+ begin
156+ Result := true;
157+ Log(' NextButtonClick(' + IntToStr(CurPageID) + ' ) called' );
158+ case CurPageID of
159+ Page.ID: begin
160+ if not LocalSystemAccountCheckBox.Checked then begin
161+ if UserEdit.Text = ' ' then begin
162+ Result := false;
163+ MsgBox(' Pleas enter User' , mbInformation, MB_OK);
164+ exit;
165+ end ;
166+ if not (ConfPassEdit.Text = PassEdit.Text) then begin
167+ Result := false;
168+ MsgBox(' Password does not match the confirm password' , mbInformation, MB_OK);
169+ exit;
170+ end ;
171+ end ;
172+ end ;
173+ end ;
174+ end ;
175+
176+ function GetUserName (Param: String): string;
177+ begin
178+ result := ' .\' + UserEdit.Text;
179+ end ;
180+
181+ function GetPassword (Param: String): string;
182+ begin
183+ result := PassEdit.Text;
184+ end ;
185+
186+ procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
187+ var
188+ mres : integer;
189+ ResultCode: Integer;
190+ begin
191+ case CurUninstallStep of
192+ usPostUninstall:
193+ begin
194+ // mres := MsgBox('Do you want to delete saved files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
195+ // if mres = IDYES then
196+ DelTree(ExpandConstant(' {userappdata}\DirectPrintServiceLogs' ), True, True, True);
197+ end ;
198+ end ;
199+ end ;
0 commit comments