2 #define APP_VERSION
'%APPVERSION%'
3 #define APP_URL
'http://msysgit.googlecode.com/'
4 #define APP_BUILTINS
'etc\fileList-builtins.txt'
8 Compression
=lzma2
/ultra
9 LZMAUseSeparateProcess
=yes
10 OutputBaseFilename
={#APP_NAME+'-'+APP_VERSION}
11 OutputDir
={#GetEnv('USERPROFILE')}
14 ; Uncomment the line below to be able to compile the script from within the IDE.
15 ;SourceDir={#GetEnv('TEMP')}\WinGit
20 AppPublisherURL
={#APP_URL}
21 AppVersion
={#APP_VERSION}
22 ChangesEnvironment
=yes
23 DefaultDirName
={pf}\
{#APP_NAME}
24 DefaultGroupName
={#APP_NAME}
26 InfoBeforeFile
=gpl
-2.0.rtf
27 PrivilegesRequired
=none
28 UninstallDisplayIcon
=etc\git
.ico
31 SetupIconFile
=etc\git
.ico
32 WizardImageBackColor
=clWhite
34 WizardImageFile
=git
.bmp
35 WizardSmallImageFile
=gitsmall
.bmp
38 ; Define a dummy type to avoid getting the default ones.
39 Name
: custom
; Description
: Custom installation
; Flags
: iscustom
42 Name
: icons
; Description
: Additional icons
; Types
: custom
43 Name
: icons\quicklaunch
; Description
: In the Quick Launch
; Types
: custom
44 Name
: icons\desktop
; Description
: On the Desktop
; Types
: custom
45 Name
: ext
; Description
: Windows Explorer integration
; Types
: custom
46 Name
: ext
\reg
; Description
: Context menu entries
; Flags
: exclusive; Types
: custom
47 Name
: ext
\reg\shellhere
; Description
: Git Bash Here
; Types
: custom
48 Name
: ext
\reg\guihere
; Description
: Git GUI Here
; Types
: custom
49 Name
: ext\cheetah
; Description
: git
-cheetah shell
extension (32-bit only
); Flags
: exclusive; Types
: custom
50 Name
: assoc
; Description
: Associate
.git
* configuration
files with the default
text editor
; Types
: custom
51 Name
: consolefont
; Description
: Use a TrueType font
in the
console (required
for proper character encoding
); Types
: custom
54 ; Install files that might be in use during setup under a different name.
55 Source
: git
-cheetah\git_shell_ext
.dll
; DestDir
: {app}\git
-cheetah
; DestName
: git_shell_ext
.dll
.new
; Flags
: replacesameversion
57 Source
: *; DestDir
: {app}; Excludes
: \
*.bmp
, gpl
-2.0.rtf
, \
*.iss
, \tmp
.*, \bin\
*install
*, \git
-cheetah\git_shell_ext
.dll
; Flags
: recursesubdirs replacesameversion
58 Source
: ReleaseNotes
.rtf
; DestDir
: {app}; Flags
: isreadme replacesameversion
61 Name
: {group}\Git GUI
; Filename
: {app}\bin\wish
.exe
; Parameters
: """{app}\libexec\git-core\git-gui"""; WorkingDir
: %HOMEDRIVE
%%HOMEPATH
%; IconFilename
: {app}\etc\git
.ico
62 Name
: {group}\Git Bash
; Filename
: {syswow64}\cmd
.exe
; Parameters
: "/c """"{app}\bin\sh.exe"" --login -i"""; WorkingDir
: %HOMEDRIVE
%%HOMEPATH
%; IconFilename
: {app}\etc\git
.ico
65 BeveledLabel
={#APP_URL}
66 SetupAppTitle
={#APP_NAME} Setup
67 SetupWindowTitle
={#APP_NAME} Setup
70 ; There is no "Console" key in HKLM.
71 Root
: HKCU
; Subkey
: Console
; ValueType
: string; ValueName
: FaceName
; ValueData
: Lucida Console
; Components
: consolefont
72 Root
: HKCU
; Subkey
: Console
; ValueType
: dword
; ValueName
: FontFamily
; ValueData
: $00000036; Components
: consolefont
73 Root
: HKCU
; Subkey
: Console
; ValueType
: dword
; ValueName
: FontSize
; ValueData
: $000e0000; Components
: consolefont
74 Root
: HKCU
; Subkey
: Console
; ValueType
: dword
; ValueName
: FontWeight
; ValueData
: $00000190; Components
: consolefont
76 Root
: HKCU
; Subkey
: Console\Git Bash
; ValueType
: string; ValueName
: FaceName
; ValueData
: Lucida Console
; Flags
: createvalueifdoesntexist
77 Root
: HKCU
; Subkey
: Console\Git Bash
; ValueType
: dword
; ValueName
: FontFamily
; ValueData
: $00000036; Flags
: createvalueifdoesntexist
78 Root
: HKCU
; Subkey
: Console\Git Bash
; ValueType
: dword
; ValueName
: FontSize
; ValueData
: $000e0000; Flags
: createvalueifdoesntexist
79 Root
: HKCU
; Subkey
: Console\Git Bash
; ValueType
: dword
; ValueName
: FontWeight
; ValueData
: $00000190; Flags
: createvalueifdoesntexist
81 ; File associations for configuration files that may be contained in a repository (so this does not include ".gitconfig").
82 Root
: HKLM
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
83 Root
: HKLM
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
84 Root
: HKLM
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
85 Root
: HKCU
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
86 Root
: HKCU
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
87 Root
: HKCU
; Subkey
: Software\Classes\
.gitattributes
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
89 Root
: HKLM
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
90 Root
: HKLM
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
91 Root
: HKLM
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
92 Root
: HKCU
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
93 Root
: HKCU
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
94 Root
: HKCU
; Subkey
: Software\Classes\
.gitignore
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
96 Root
: HKLM
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
97 Root
: HKLM
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
98 Root
: HKLM
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: IsAdminLoggedOn
; Components
: assoc
99 Root
: HKCU
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueData
: txtfile
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
100 Root
: HKCU
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueName
: Content
Type; ValueData
: text/plain
; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
101 Root
: HKCU
; Subkey
: Software\Classes\
.gitmodules
; ValueType
: string; ValueName
: PerceivedType
; ValueData
: text; Flags
: createvalueifdoesntexist; Check
: not IsAdminLoggedOn
; Components
: assoc
104 ; Delete the built-ins.
105 Type: files; Name
: {app}\bin\git
-*.exe
106 Type: files; Name
: {app}\libexec\git
-core\git
-*.exe
107 Type: files; Name
: {app}\libexec\git
-core\git
.exe
109 ; Delete any (temporary) git-cheetah files.
110 Type: files; Name
: {app}\git
-cheetah\
*.*
112 ; Delete any manually created shortcuts.
113 Type: files; Name
: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Git Bash
.lnk
114 Type: files; Name
: {code:GetShellFolder|desktop}\Git Bash
.lnk
115 Type: files; Name
: {app}\Git Bash
.lnk
117 ; Delete a home directory inside the msysGit directory.
118 Type: dirifempty; Name
: {app}\home\
{username}
119 Type: dirifempty; Name
: {app}\home
122 #include
"helpers.inc.iss"
123 #include
"putty.inc.iss"
124 #include
"modules.inc.iss"
126 function CreateHardLink(lpFileName
,lpExistingFileName
:String;lpSecurityAttributes
:Integer):Boolean;
128 external 'CreateHardLinkW@Kernel32.dll stdcall delayload setuponly';
130 external 'CreateHardLinkA@Kernel32.dll stdcall delayload setuponly';
133 function CreateSymbolicLink(lpSymlinkFileName
,lpTargetFileName
:String;dwFlags
:DWORD
):Boolean;
135 external 'CreateSymbolicLinkW@Kernel32.dll stdcall delayload setuponly';
137 external 'CreateSymbolicLinkA@Kernel32.dll stdcall delayload setuponly';
150 // Git line ending conversion options
.
153 GC_CRLFCommitAsIs
= 3;
156 // Wizard page
and variables
for the Path options
.
157 PathPage
:TWizardPage
;
158 RdbPath
:array[GP_BashOnly
..GP_CmdTools
] of TRadioButton
;
160 // Wizard page
and variables
for the SSH options
.
161 PuTTYPage
:TWizardPage
;
162 RdbSSH
:array[GS_OpenSSH
..GS_Plink
] of TRadioButton
;
165 // Wizard page
and variables
for the line ending conversion options
.
166 CRLFPage
:TWizardPage
;
167 RdbCRLF
:array[GC_LFOnly
..GC_CRLFCommitAsIs
] of TRadioButton
;
169 // Wizard page
and variables
for the processes page
.
170 Processes
:ProcessList
;
171 ProcessesPage
:TWizardPage
;
172 ProcessesListBox
:TListBox
;
173 ProcessesRefresh
,ContinueButton
:TButton
;
175 procedure BrowseForPuTTYFolder(Sender
:TObject
);
179 Path
:=ExtractFilePath(EdtPlink
.Text);
180 BrowseForFolder('Please select the PuTTY folder:',Path
,False);
181 if FileExists(Path
+'\TortoisePlink.exe') then begin
182 EdtPlink
.Text:=Path
+'\TortoisePlink.exe';
183 RdbSSH
[GS_Plink
].Checked
:=True;
184 end else if FileExists(Path
+'\plink.exe') then begin
185 EdtPlink
.Text:=Path
+'\plink.exe';
186 RdbSSH
[GS_Plink
].Checked
:=True;
188 MsgBox('Please enter a valid path to "TortoisePlink.exe" or "plink.exe".',mbError
,MB_OK
);
192 procedure DeleteContextMenuEntries
;
194 AppDir
,Command
,Msg
:String;
197 AppDir
:=ExpandConstant('{app}');
199 if IsAdminLoggedOn
then begin
200 RootKey
:=HKEY_LOCAL_MACHINE
;
202 RootKey
:=HKEY_CURRENT_USER
;
206 RegQueryStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_shell\command','',Command
);
207 if Pos(AppDir
,Command
)>0 then begin
208 if not RegDeleteKeyIncludingSubkeys(RootKey
,'SOFTWARE\Classes\Directory\shell\git_shell') then begin
209 Msg
:='Line {#__LINE__}: Unable to remove "Git Bash Here" shell extension.';
210 MsgBox(Msg
,mbError
,MB_OK
);
212 // This
is not a critical error
, the user can probably fix it manually
,
218 RegQueryStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_gui\command','',Command
);
219 if Pos(AppDir
,Command
)>0 then begin
220 if not RegDeleteKeyIncludingSubkeys(RootKey
,'SOFTWARE\Classes\Directory\shell\git_gui') then begin
221 Msg
:='Line {#__LINE__}: Unable to remove "Git GUI Here" shell extension.';
222 MsgBox(Msg
,mbError
,MB_OK
);
224 // This
is not a critical error
, the user can probably fix it manually
,
230 procedure RefreshProcessList(Sender
:TObject
);
232 Modules
:TArrayOfString
;
233 ProcsCloseRequired
,ProcsCloseRestart
:ProcessList
;
238 SetArrayLength(Modules
,2);
239 Modules
[0]:=ExpandConstant('{app}\bin\msys-1.0.dll');
240 Modules
[1]:=ExpandConstant('{app}\bin\tcl85.dll');
241 Found
:=FindProcessesUsingModules(Modules
,ProcsCloseRequired
);
243 Found
:=FindProcessesUsingModule(ExpandConstant('{app}\git-cheetah\git_shell_ext.dll'),ProcsCloseRestart
) or Found
;
245 // Misuse the
"Restartable" flag
to indicate which processes are required
246 // to be closed before setup can continue
, and which just should be closed
247 // in order
to make changes take effect immediately
.
248 SetArrayLength(Processes
,GetArrayLength(ProcsCloseRequired
)+GetArrayLength(ProcsCloseRestart
));
249 for i
:=0 to GetArrayLength(ProcsCloseRequired
)-1 do begin
250 Processes
[i
]:=ProcsCloseRequired
[i
];
251 Processes
[i
].Restartable
:=False;
253 for i
:=0 to GetArrayLength(ProcsCloseRestart
)-1 do begin
254 Processes
[GetArrayLength(ProcsCloseRequired
)+i
]:=ProcsCloseRestart
[i
];
255 Processes
[GetArrayLength(ProcsCloseRequired
)+i
].Restartable
:=True;
258 ProcessesListBox
.Items
.Clear
;
259 if (Sender
=NIL) or Found
then begin
260 for i
:=0 to GetArrayLength(Processes
)-1 do begin
261 Caption
:=Processes
[i
].Name
+' (PID '+IntToStr(Processes
[i
].ID
);
262 if not Processes
[i
].Restartable
then begin
263 Caption
:=Caption
+', closing is required';
265 Caption
:=Caption
+')';
266 ProcessesListBox
.Items
.Append(Caption
);
270 if ContinueButton
<>NIL then begin
271 ContinueButton
.Enabled
:=(GetArrayLength(ProcsCloseRequired
)=0);
279 procedure InitializeWizard
;
281 i
,PrevPageID
:Integer;
282 LblGitBash
,LblGitCmd
,LblGitCmdTools
,LblGitCmdToolsWarn
:TLabel
;
283 LblOpenSSH
,LblPlink
:TLabel
;
284 PuTTYSessions
:TArrayOfString
;
285 LblLFOnly
,LblCRLFAlways
,LblCRLFCommitAsIs
:TLabel
;
289 // Until we have a
64-bit version
of git
-cheetah
, disable it on
64-bit Windows
.
290 if isWin64
then begin
291 for i
:=0 to WizardForm
.ComponentsList
.Items
.Count
-1 do begin
292 Data
:=LowerCase(WizardForm
.ComponentsList
.ItemCaption
[i
]);
293 if Pos('context',Data
)>0 then begin
294 // Select the Registry
-based context menu entries
.
295 WizardForm
.ComponentsList
.Checked
[i
]:=True;
296 end else if Pos('cheetah',Data
)>0 then begin
297 // Disable the git
-cheetah shell extension
.
298 WizardForm
.ComponentsList
.ItemEnabled
[i
]:=False;
303 PrevPageID
:=wpSelectProgramGroup
;
306 * Create a custom page for modifying the environment.
309 PathPage
:=CreateCustomPage(
311 'Adjusting your PATH environment',
312 'How would you like to use Git from the command line?'
314 PrevPageID
:=PathPage
.ID
;
317 RdbPath
[GP_BashOnly
]:=TRadioButton
.Create(PathPage
);
318 with RdbPath
[GP_BashOnly
] do begin
319 Parent
:=PathPage
.Surface
;
320 Caption
:='Use Git Bash only';
325 Font
.Style
:=[fsBold
];
329 LblGitBash
:=TLabel
.Create(PathPage
);
330 with LblGitBash
do begin
331 Parent
:=PathPage
.Surface
;
333 'This is the most conservative choice if you are concerned about the stability' + #
13 +
334 'of your system. Your PATH will not be modified.';
342 RdbPath
[GP_Cmd
]:=TRadioButton
.Create(PathPage
);
343 with RdbPath
[GP_Cmd
] do begin
344 Parent
:=PathPage
.Surface
;
345 Caption
:='Run Git from the Windows Command Prompt';
350 Font
.Style
:=[fsBold
];
353 LblGitCmd
:=TLabel
.Create(PathPage
);
354 with LblGitCmd
do begin
355 Parent
:=PathPage
.Surface
;
357 'This option is considered safe and no conflicts with other tools are known.' + #
13 +
358 'Only Git will be added to your PATH. Use this option if you want to use Git' + #
13 +
359 'from a Cygwin Prompt (make sure to not have Cygwin''s Git installed).';
367 RdbPath
[GP_CmdTools
]:=TRadioButton
.Create(PathPage
);
368 with RdbPath
[GP_CmdTools
] do begin
369 Parent
:=PathPage
.Surface
;
370 Caption
:='Run Git and included Unix tools from the Windows Command Prompt';
375 Font
.Style
:=[fsBold
];
378 LblGitCmdTools
:=TLabel
.Create(PathPage
);
379 with LblGitCmdTools
do begin
380 Parent
:=PathPage
.Surface
;
381 Caption
:='Both Git and its accompanying Unix tools will be added to your PATH.';
387 LblGitCmdToolsWarn
:=TLabel
.Create(PathPage
);
388 with LblGitCmdToolsWarn
do begin
389 Parent
:=PathPage
.Surface
;
391 'Warning: This will override Windows tools like find.exe and' + #
13 +
392 'sort.exe. Select this option only if you understand the implications.';
398 Font
.Style
:=[fsBold
];
401 // Restore the setting chosen during a previous install
.
402 Data
:=GetPreviousData('Path Option','BashOnly');
403 if Data
='BashOnly' then begin
404 RdbPath
[GP_BashOnly
].Checked
:=True;
405 end else if Data
='Cmd' then begin
406 RdbPath
[GP_Cmd
].Checked
:=True;
407 end else if Data
='CmdTools' then begin
408 RdbPath
[GP_CmdTools
].Checked
:=True;
412 * Create a custom page for using (Tortoise)Plink instead of OpenSSH
413 * if at least one PuTTY session is found in the Registry.
416 if RegGetSubkeyNames(HKEY_CURRENT_USER
,'Software\SimonTatham\PuTTY\Sessions',PuTTYSessions
) and (GetArrayLength(PuTTYSessions
)>0) then begin
417 PuTTYPage
:=CreateCustomPage(
419 'Choosing the SSH executable',
420 'Which Secure Shell client program would you like Git to use?'
422 PrevPageID
:=PuTTYPage
.ID
;
425 RdbSSH
[GS_OpenSSH
]:=TRadioButton
.Create(PuTTYPage
);
426 with RdbSSH
[GS_OpenSSH
] do begin
427 Parent
:=PuTTYPage
.Surface
;
428 Caption
:='Use OpenSSH';
433 Font
.Style
:=[fsBold
];
437 LblOpenSSH
:=TLabel
.Create(PuTTYPage
);
438 with LblOpenSSH
do begin
439 Parent
:=PuTTYPage
.Surface
;
441 'This uses ssh.exe that comes with Git. The GIT_SSH and SVN_SSH' + #
13 +
442 'environment variables will not be modified.';
450 RdbSSH
[GS_Plink
]:=TRadioButton
.Create(PuTTYPage
);
451 with RdbSSH
[GS_Plink
] do begin
452 Parent
:=PuTTYPage
.Surface
;
453 Caption
:='Use (Tortoise)Plink';
458 Font
.Style
:=[fsBold
];
461 LblPlink
:=TLabel
.Create(PuTTYPage
);
462 with LblPlink
do begin
463 Parent
:=PuTTYPage
.Surface
;
465 'PuTTY sessions were found in your Registry. You may specify the path' + #
13 +
466 'to an existing copy of (Tortoise)Plink.exe from the TortoiseSVN/CVS' + #
13 +
467 'or PuTTY applications. The GIT_SSH and SVN_SSH environment' + #
13 +
468 'variables will be adjusted to point to the following executable:';
474 EdtPlink
:=TEdit
.Create(PuTTYPage
);
475 with EdtPlink
do begin
476 Parent
:=PuTTYPage
.Surface
;
477 Text:=GetPuTTYLocation
;
478 if not FileExists(Text) then begin
486 BtnPlink
:=TButton
.Create(PuTTYPage
);
487 with BtnPlink
do begin
488 Parent
:=PuTTYPage
.Surface
;
490 OnClick
:=@BrowseForPuTTYFolder
;
497 // Restore the setting chosen during a previous install
.
498 Data
:=GetPreviousData('SSH Option','OpenSSH');
499 if Data
='OpenSSH' then begin
500 RdbSSH
[GS_OpenSSH
].Checked
:=True;
501 end else if Data
='Plink' then begin
502 RdbSSH
[GS_Plink
].Checked
:=True;
509 * Create a custom page for the core.autocrlf setting.
512 CRLFPage
:=CreateCustomPage(
514 'Configuring the line ending conversions',
515 'How should Git treat line endings in text files?'
517 PrevPageID
:=CRLFPage
.ID
;
520 RdbCRLF
[GC_CRLFAlways
]:=TRadioButton
.Create(CRLFPage
);
521 with RdbCRLF
[GC_CRLFAlways
] do begin
522 Parent
:=CRLFPage
.Surface
;
523 Caption
:='Checkout Windows-style, commit Unix-style line endings';
528 Font
.Style
:=[fsBold
];
532 LblCRLFAlways
:=TLabel
.Create(CRLFPage
);
533 with LblCRLFAlways
do begin
534 Parent
:=CRLFPage
.Surface
;
536 'Git will convert LF to CRLF when checking out text files. When committing' + #
13 +
537 'text files, CRLF will be converted to LF. For cross-platform projects,' + #
13 +
538 'this is the recommended setting on Windows ("core.autocrlf" is set to "true").';
546 RdbCRLF
[GC_LFOnly
]:=TRadioButton
.Create(CRLFPage
);
547 with RdbCRLF
[GC_LFOnly
] do begin
548 Parent
:=CRLFPage
.Surface
;
549 Caption
:='Checkout as-is, commit Unix-style line endings';
554 Font
.Style
:=[fsBold
];
558 LblLFOnly
:=TLabel
.Create(CRLFPage
);
559 with LblLFOnly
do begin
560 Parent
:=CRLFPage
.Surface
;
562 'Git will not perform any conversion when checking out text files. When' + #
13 +
563 'committing text files, CRLF will be converted to LF. For cross-platform projects,' + #
13 +
564 'this is the recommended setting on Unix ("core.autocrlf" is set to "input").';
572 RdbCRLF
[GC_CRLFCommitAsIs
]:=TRadioButton
.Create(CRLFPage
);
573 with RdbCRLF
[GC_CRLFCommitAsIs
] do begin
574 Parent
:=CRLFPage
.Surface
;
575 Caption
:='Checkout as-is, commit as-is';
580 Font
.Style
:=[fsBold
];
584 LblCRLFCommitAsIs
:=TLabel
.Create(CRLFPage
);
585 with LblCRLFCommitAsIs
do begin
586 Parent
:=CRLFPage
.Surface
;
588 'Git will not perform any conversions when checking out or committing' + #
13 +
589 'text files. Choosing this option is not recommended for cross-platform' + #
13 +
590 'projects ("core.autocrlf" is set to "false").';
597 // Restore the setting chosen during a previous install
.
598 Data
:=GetPreviousData('CRLF Option','CRLFAlways');
599 if Data
='LFOnly' then begin
600 RdbCRLF
[GC_LFOnly
].Checked
:=True;
601 end else if Data
='CRLFAlways' then begin
602 RdbCRLF
[GC_CRLFAlways
].Checked
:=True;
603 end else if Data
='CRLFCommitAsIs' then begin
604 RdbCRLF
[GC_CRLFCommitAsIs
].Checked
:=True;
608 * Create a custom page for finding the processes that lock a module.
611 ProcessesPage
:=CreateCustomPage(
613 'Replacing in-use files',
614 'The following applications use files that need to be replaced, please close them.'
617 ProcessesListBox
:=TListBox
.Create(ProcessesPage
);
618 with ProcessesListBox
do begin
619 Parent
:=ProcessesPage
.Surface
;
620 Width
:=ProcessesPage
.SurfaceWidth
;
621 Height
:=ProcessesPage
.SurfaceHeight
-ScaleY(8);
624 ProcessesRefresh
:=TNewButton
.Create(WizardForm
);
625 with ProcessesRefresh
do begin
627 Width
:=WizardForm
.NextButton
.Width
;
628 Height
:=WizardForm
.NextButton
.Height
;
629 Top
:=WizardForm
.NextButton
.Top
;
630 Left
:=WizardForm
.ClientWidth
-WizardForm
.NextButton
.Left
-WizardForm
.NextButton
.Width
;
632 OnClick
:=@RefreshProcessList
;
635 // This button
is only used by the uninstaller
.
638 // Initially hide the Refresh button
, show it when the process page becomes current
.
639 ProcessesRefresh
.Hide
;
642 function ShouldSkipPage(PageID
:Integer):Boolean;
644 if (ProcessesPage
<>NIL) and (PageID
=ProcessesPage
.ID
) then begin
645 // This page
is only reached
forward (by pressing
"Next", never by pressing
"Back").
646 RefreshProcessList(NIL);
647 Result
:=(GetArrayLength(Processes
)=0);
653 procedure CurPageChanged(CurPageID
:Integer);
655 // Show the
"Refresh" button only on the processes page
.
656 if (ProcessesPage
<>NIL) and (CurPageID
=ProcessesPage
.ID
) then begin
657 ProcessesRefresh
.Show
;
659 ProcessesRefresh
.Hide
;
663 function NextButtonClick(CurPageID
:Integer):Boolean;
669 if (PuTTYPage
<>NIL) and (CurPageID
=PuTTYPage
.ID
) then begin
670 Result
:=RdbSSH
[GS_OpenSSH
].Checked
or
671 (RdbSSH
[GS_Plink
].Checked
and FileExists(EdtPlink
.Text));
672 if not Result
then begin
673 MsgBox('Please enter a valid path to (Tortoise)Plink.exe.',mbError
,MB_OK
);
675 end else if (ProcessesPage
<>NIL) and (CurPageID
=ProcessesPage
.ID
) then begin
676 // It would have been nicer
to just disable the
"Next" button
, but the
677 // WizardForm
exports the button just
read-only
.
678 for i
:=0 to GetArrayLength(Processes
)-1 do begin
679 if not Processes
[i
].Restartable
then begin
680 MsgBox('Setup cannot continue until you close at least those applications in the list that are marked as "closing is required".',mbCriticalError
,MB_OK
);
686 Result
:=(GetArrayLength(Processes
)=0);
688 if not Result
then begin
690 'If you continue without closing the listed applications, you will need to log off and on again before changes take effect.' + #
13 + #
13 +
691 'Are you sure you want to continue anyway?',
701 // Even though the name
of this
procedure suggests otherwise most
of the
702 // code below
is only executed once after the regular installation code
703 // is finished
. This happens because
of the
if-guard right
in the
704 // beginning
of this
procedure.
705 procedure CurStepChanged(CurStep
:TSetupStep
);
707 AppDir
,FileName
,TempName
,Cmd
,Msg
:String;
708 BuiltIns
,EnvPath
,EnvHome
,EnvSSH
:TArrayOfString
;
714 if CurStep
<>ssPostInstall
then begin
718 AppDir
:=ExpandConstant('{app}');
724 // Load the built
-ins from a
text file.
725 FileName
:=ExpandConstant('{app}\{#APP_BUILTINS}');
726 if LoadStringsFromFile(FileName
,BuiltIns
) then begin
727 Count
:=GetArrayLength(BuiltIns
)-1;
729 // Delete those scripts from
"bin" which have been replaced by built
-ins
in "libexec\git-core".
730 for i
:=0 to Count
do begin
731 FileName
:=AppDir
+'\bin\'+ChangeFileExt(ExtractFileName(BuiltIns[i]),'');
732 if FileExists(FileName) and (not DeleteFile(FileName)) then begin
733 Log('Line
{#__LINE__}: Unable
to delete script
"'+FileName+'", ignoring
.');
737 // Create built-ins as aliases for git.exe.
738 for i:=0 to Count do begin
739 FileName:=AppDir+'\'+BuiltIns
[i
];
741 // Delete any existing built
-in.
742 if FileExists(FileName
) and (not DeleteFile(FileName
)) then begin
743 Log('Line {#__LINE__}: Unable to delete existing built-in "'+FileName
+'", skipping.');
748 // This will throw an exception on pre
-WinVista systems
.
749 LinkCreated
:=CreateSymbolicLink(FileName
,AppDir
+'\bin\git.exe',0);
752 Log('Line {#__LINE__}: Creating symbolic link "'+FileName
+'" failed, will try a hard link.');
755 if not LinkCreated
then begin
757 // This will throw an exception on pre
-Win2k systems
.
758 LinkCreated
:=CreateHardLink(FileName
,AppDir
+'\bin\git.exe',0);
761 Log('Line {#__LINE__}: Creating hardlink "'+FileName
+'" failed, will try a copy.');
765 if not LinkCreated
then begin
766 if not FileCopy(AppDir
+'\bin\git.exe',FileName
,False) then begin
767 Log('Line {#__LINE__}: Creating copy "'+FileName
+'" failed, giving up.');
768 // This
is not a critical error
, Git could basically be used without the
769 // aliases
for built
-ins
, so we continue
.
774 // Delete any duplicate
files in case we are updating from a non
-libexec
to a libexec directory layout
.
775 if FindFirst(AppDir
+'\libexec\git-core\*',FindRec
) then begin
777 if (FindRec
.Attributes
and FILE_ATTRIBUTE_DIRECTORY
)=0 then begin
778 FileName
:=AppDir
+'\bin\'+FindRec.name;
779 if (Pos(FindRec.name,'git
.exe
')<>1) and FileExists(FileName) and (not DeleteFile(FileName)) then begin
780 Log('Line
{#__LINE__}: Unable
to delete dupe
"'+FileName+'", ignoring
.');
783 until not FindNext(FindRec);
787 Msg:='Line
{#__LINE__}: Unable
to read file "{#APP_BUILTINS}".';
788 MsgBox(Msg,mbError,MB_OK);
790 // This is not a critical error, Git could basically be used without the
791 // aliases for built-ins, so we continue.
798 if RdbCRLF[GC_LFOnly].checked then begin
799 Cmd:='core
.autocrlf input
';
800 end else if RdbCRLF[GC_CRLFAlways].checked then begin
801 Cmd:='core
.autocrlf
true';
803 Cmd:='core
.autocrlf
false';
805 if not Exec(AppDir + '\bin\git
.exe
', 'config
-f gitconfig
' + Cmd,
806 AppDir + '\etc
', SW_HIDE, ewWaitUntilTerminated, i) then begin
807 Msg:='Unable
to configure the line ending conversion
: ' + Cmd;
808 MsgBox(Msg,mbError,MB_OK);
810 // This is not a critical error, the user can probably fix it manually,
815 Modify the environment
817 This must happen no later than ssPostInstall to make
818 "ChangesEnvironment=yes" not happend before the change!
821 FileName:=AppDir+'\setup
.ini
';
823 // Delete GIT_SSH and SVN_SSH if a previous installation set them (this is required for the GS_OpenSSH case).
824 EnvSSH:=GetEnvStrings('GIT_SSH
',IsAdminLoggedOn);
825 if (GetArrayLength(EnvSSH)=1) and
826 (CompareStr(RemoveQuotes(EnvSSH[0]),GetIniString('Environment
','GIT_SSH
','',FileName))=0) then begin
827 if not SetEnvStrings('GIT_SSH
',IsAdminLoggedOn,True,[]) then begin
828 Msg:='Line
{#__LINE__}: Unable
to reset GIT_SSH prior
to install
.';
829 MsgBox(Msg,mbError,MB_OK);
831 // This is not a critical error, the user can probably fix it manually,
836 EnvSSH:=GetEnvStrings('SVN_SSH
',IsAdminLoggedOn);
837 if (GetArrayLength(EnvSSH)=1) and
838 (CompareStr(RemoveQuotes(EnvSSH[0]),GetIniString('Environment
','SVN_SSH
','',FileName))=0) then begin
839 if not SetEnvStrings('SVN_SSH
',IsAdminLoggedOn,True,[]) then begin
840 Msg:='Line
{#__LINE__}: Unable
to reset SVN_SSH prior
to install
.';
841 MsgBox(Msg,mbError,MB_OK);
843 // This is not a critical error, the user can probably fix it manually,
848 if (PuTTYPage<>NIL) and RdbSSH[GS_Plink].Checked then begin
849 SetArrayLength(EnvSSH,1);
850 EnvSSH[0]:=EdtPlink.Text;
852 // Set GIT_SSH as specified by the user.
853 if not SetEnvStrings('GIT_SSH
',IsAdminLoggedOn,True,EnvSSH) then begin
854 Msg:='Line
{#__LINE__}: Unable
to set the GIT_SSH environment variable
.';
855 MsgBox(Msg,mbError,MB_OK);
857 // This is not a critical error, the user can probably fix it manually,
861 // Mark that we have changed GIT_SSH by writing its value to a file.
862 if not SetIniString('Environment
','GIT_SSH
',EnvSSH[0],FileName) then begin
863 Msg:='Line
{#__LINE__}: Unable
to write
to file "'+FileName+'".';
864 MsgBox(Msg,mbError,MB_OK);
866 // This is not a critical error, though uninstall / reinstall will probably not run cleanly,
870 // Set SVN_SSH as specified by the user, but with escaped backslashes and quotes.
871 StringChangeEx(EnvSSH[0],'\','\\',True);
872 EnvSSH
[0]:=AddQuotes(EnvSSH
[0]);
874 if not SetEnvStrings('SVN_SSH',IsAdminLoggedOn
,True,EnvSSH
) then begin
875 Msg
:='Line {#__LINE__}: Unable to set the SVN_SSH environment variable.';
876 MsgBox(Msg
,mbError
,MB_OK
);
878 // This
is not a critical error
, the user can probably fix it manually
,
882 // Mark that we have changed SVN_SSH by writing its value
to a
file.
883 if not SetIniString('Environment','SVN_SSH',EnvSSH
[0],FileName
) then begin
884 Msg
:='Line {#__LINE__}: Unable to write to file "'+FileName
+'".';
885 MsgBox(Msg
,mbError
,MB_OK
);
887 // This
is not a critical error
, though uninstall
/ reinstall will probably
not run cleanly
,
892 // Get the current user
's directories in PATH.
893 EnvPath:=GetEnvStrings('PATH
',IsAdminLoggedOn);
895 // First, remove the installation directory from PATH in any case.
896 for i:=0 to GetArrayLength(EnvPath)-1 do begin
897 if Pos(AppDir+'\',EnvPath
[i
]+'\')=1 then begin
902 // Delete HOME if a previous installation modified it.
903 EnvHome:=GetEnvStrings('HOME
',IsAdminLoggedOn);
904 if (GetArrayLength(EnvHome)=1) and
905 (CompareStr(RemoveQuotes(EnvHome[0]),GetIniString('Environment
','HOME
','',FileName))=0) then begin
906 if not SetEnvStrings('HOME
',IsAdminLoggedOn,True,[]) then begin
907 Msg:='Line
{#__LINE__}: Unable
to reset HOME prior
to install
.';
908 MsgBox(Msg,mbError,MB_OK);
910 // This is not a critical error, the user can probably fix it manually,
915 // Modify the PATH variable as requested by the user.
916 if RdbPath[GP_Cmd].Checked or RdbPath[GP_CmdTools].Checked then begin
917 i:=GetArrayLength(EnvPath);
918 SetArrayLength(EnvPath,i+1);
920 // List \cmd before \bin so \cmd has higher priority and programs in
921 // there will be called in favor of those in \bin.
922 EnvPath[i]:=AppDir+'\cmd
';
924 if RdbPath[GP_CmdTools].Checked then begin
925 SetArrayLength(EnvPath,i+2);
926 EnvPath[i+1]:=AppDir+'\bin
';
928 // Set HOME for the Windows Command Prompt, but only if it has not been set manually before.
929 EnvHome:=GetEnvStrings('HOME
',IsAdminLoggedOn);
930 i:=GetArrayLength(EnvHome);
931 if (i=0) or ((i=1) and (Length(EnvHome[0])=0)) then begin
932 SetArrayLength(EnvHome,1);
933 EnvHome[0]:=ExpandConstant('{%HOMEDRIVE}{%HOMEPATH}');
934 if not SetEnvStrings('HOME
',IsAdminLoggedOn,True,EnvHome) then begin
935 Msg:='Line
{#__LINE__}: Unable
to set the HOME environment variable
.';
936 MsgBox(Msg,mbError,MB_OK);
938 // This is not a critical error, the user can probably fix it manually,
942 // Mark that we have changed HOME.
943 if not SetIniString('Environment
','HOME
',EnvHome[0],FileName) then begin
944 Msg:='Line
{#__LINE__}: Unable
to write
to file "'+FileName+'".';
945 MsgBox(Msg,mbError,MB_OK);
947 // This is not a critical error, though uninstall / reinstall will probably not run cleanly,
954 // Set the current user's PATH directories
.
955 if not SetEnvStrings('PATH',IsAdminLoggedOn
,True,EnvPath
) then begin
956 Msg
:='Line {#__LINE__}: Unable to set the PATH environment variable.';
957 MsgBox(Msg
,mbError
,MB_OK
);
959 // This
is not a critical error
, the user can probably fix it manually
,
964 Create shortcuts that need to be created regardless of the "Don't create a Start Menu folder" toggle
967 Cmd
:=ExpandConstant('{syswow64}\cmd.exe');
968 TempName
:='/c ""'+AppDir
+'\bin\sh.exe" --login -i"';
969 FileName
:=AppDir
+'\etc\git.ico';
971 if IsComponentSelected('icons\quicklaunch') then begin
973 ExpandConstant('{userappdata}\Microsoft\Internet Explorer\Quick Launch\Git Bash.lnk')
977 , '%HOMEDRIVE%%HOMEPATH%'
983 if IsComponentSelected('icons\desktop') then begin
985 GetShellFolder('desktop')+'\Git Bash.lnk'
989 , '%HOMEDRIVE%%HOMEPATH%'
996 // Create a special shortcut that does
not set a working
directory (Note
: Since Inno Setup
5.3.11,
997 // passing an empty WorkingDir gets replaced
with {sys}, so use
'.' instead
).
998 // This shortcut
is used by
"Git Bash.vbs", which
in turn
is run by the
"Git Bash Here" shell extension
.
1000 AppDir
+'\Git Bash.lnk'
1011 Create the Windows Explorer integrations
1014 if IsAdminLoggedOn
then begin
1015 RootKey
:=HKEY_LOCAL_MACHINE
;
1017 RootKey
:=HKEY_CURRENT_USER
;
1020 if IsComponentSelected('ext\reg\shellhere') then begin
1021 if (not RegWriteStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_shell','','Git Ba&sh Here')) or
1022 (not RegWriteStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_shell\command','','wscript "'+AppDir
+'\Git Bash.vbs" "%1"')) then begin
1023 Msg
:='Line {#__LINE__}: Unable to create "Git Bash Here" shell extension.';
1024 MsgBox(Msg
,mbError
,MB_OK
);
1026 // This
is not a critical error
, the user can probably fix it manually
,
1031 if IsComponentSelected('ext\reg\guihere') then begin
1032 if (not RegWriteStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_gui','','Git &GUI Here')) or
1033 (not RegWriteStringValue(RootKey
,'SOFTWARE\Classes\Directory\shell\git_gui\command','','"'+AppDir
+'\bin\wish.exe" "'+AppDir
+'\libexec\git-core\git-gui" "--working-dir" "%1"')) then begin
1034 Msg
:='Line {#__LINE__}: Unable to create "Git GUI Here" shell extension.';
1035 MsgBox(Msg
,mbError
,MB_OK
);
1037 // This
is not a critical error
, the user can probably fix it manually
,
1042 // It
is either the Registry
-based context menu entries
, or the shell extension
.
1043 if IsComponentSelected('ext\cheetah') then begin
1044 DeleteContextMenuEntries
;
1046 FileName
:=AppDir
+'\git-cheetah\git_shell_ext.dll';
1047 if not ReplaceInUseFile(FileName
,FileName
+'.new',True) then begin
1048 Log('Line {#__LINE__}: Replacing file "'+FileName
+'" failed.');
1053 procedure RegisterPreviousData(PreviousDataKey
:Integer);
1057 // Git Path options
.
1059 if RdbPath
[GP_BashOnly
].Checked
then begin
1061 end else if RdbPath
[GP_Cmd
].Checked
then begin
1063 end else if RdbPath
[GP_CmdTools
].Checked
then begin
1066 SetPreviousData(PreviousDataKey
,'Path Option',Data
);
1070 if (PuTTYPage
=NIL) or RdbSSH
[GS_OpenSSH
].Checked
then begin
1072 end else if RdbSSH
[GS_Plink
].Checked
then begin
1075 SetPreviousData(PreviousDataKey
,'SSH Option',Data
);
1077 // Line ending conversion options
.
1079 if RdbCRLF
[GC_LFOnly
].Checked
then begin
1081 end else if RdbCRLF
[GC_CRLFAlways
].Checked
then begin
1083 end else if RdbCRLF
[GC_CRLFCommitAsIs
].Checked
then begin
1084 Data
:='CRLFCommitAsIs';
1086 SetPreviousData(PreviousDataKey
,'CRLF Option',Data
);
1093 function InitializeUninstall
:Boolean;
1097 ExitButton
,RefreshButton
:TButton
;
1101 Form
:=CreateCustomForm
;
1103 Form
.Caption
:='Git Uninstall: Removing in-use files';
1104 Form
.ClientWidth
:=ScaleX(500);
1105 Form
.ClientHeight
:=ScaleY(256);
1108 Info
:=TLabel
.Create(Form
);
1114 Caption
:='The following applications use files that need to be removed, please close them.';
1117 ContinueButton
:=TButton
.Create(Form
);
1118 with ContinueButton
do begin
1120 Left
:=Form
.ClientWidth
-ScaleX(75+10);
1121 Top
:=Form
.ClientHeight
-ScaleY(23+10);
1124 Caption
:='Continue';
1128 ExitButton
:=TButton
.Create(Form
);
1129 with ExitButton
do begin
1131 Left
:=ContinueButton
.Left
-ScaleX(75+6);
1132 Top
:=ContinueButton
.Top
;
1136 ModalResult
:=mrCancel
;
1140 RefreshButton
:=TButton
.Create(Form
);
1141 with RefreshButton
do begin
1144 Top
:=ExitButton
.Top
;
1148 OnClick
:=@RefreshProcessList
;
1151 ProcessesListBox
:=TListBox
.Create(Form
);
1152 with ProcessesListBox
do begin
1155 Top
:=Info
.Top
+Info
.Height
+11;
1156 Width
:=Form
.ClientWidth
-ScaleX(11*2);
1157 Height
:=ContinueButton
.Top
-ScaleY(11*4);
1160 Form
.ActiveControl
:=ContinueButton
;
1162 RefreshProcessList(NIL);
1163 if GetArrayLength(Processes
)>0 then begin
1164 // Now that these dialogs are going
to be shown
, we should probably
1165 // disable the
"Are you sure to remove Git?" confirmation dialog
, but
1166 // unfortunately that
is not possible
with Inno Setup currently
.
1167 Result
:=(Form
.ShowModal()=mrOk
);
1169 // Note
: The number
of processes might have changed during a refresh
.
1170 if Result
and (GetArrayLength(Processes
)>0) then begin
1172 'If you continue without closing the listed applications, you will need to log off and on again to remove some files manually.' + #
13 + #
13 +
1173 'Are you sure you want to continue anyway?',
1186 // Even though the name
of this
function suggests otherwise most
of the
1187 // code below
is only executed right before the actual uninstallation
.
1188 // This happens because
of the
if-guard right
in the beginning
of this
1190 procedure CurUninstallStepChanged(CurUninstallStep
:TUninstallStep
);
1192 AppDir
,FileName
,Msg
:String;
1193 EnvPath
,EnvHome
,EnvSSH
:TArrayOfString
;
1196 if CurUninstallStep
<>usUninstall
then begin
1201 Modify the environment
1203 This must happen no later than usUninstall to make
1204 "ChangesEnvironment=yes" not happend before the change!
1207 AppDir
:=ExpandConstant('{app}');
1208 FileName
:=AppDir
+'\setup.ini';
1210 // Delete the current user
's GIT_SSH and SVN_SSH if we set it.
1211 EnvSSH:=GetEnvStrings('GIT_SSH
',IsAdminLoggedOn);
1212 if (GetArrayLength(EnvSSH)=1) and
1213 (CompareStr(RemoveQuotes(EnvSSH[0]),GetIniString('Environment
','GIT_SSH
','',FileName))=0) then begin
1214 if not SetEnvStrings('GIT_SSH
',IsAdminLoggedOn,True,[]) then begin
1215 Msg:='Line
{#__LINE__}: Unable
to revert any possible changes
to GIT_SSH
.';
1216 MsgBox(Msg,mbError,MB_OK);
1218 // This is not a critical error, the user can probably fix it manually,
1223 EnvSSH:=GetEnvStrings('SVN_SSH
',IsAdminLoggedOn);
1224 if (GetArrayLength(EnvSSH)=1) and
1225 (CompareStr(RemoveQuotes(EnvSSH[0]),GetIniString('Environment
','SVN_SSH
','',FileName))=0) then begin
1226 if not SetEnvStrings('SVN_SSH
',IsAdminLoggedOn,True,[]) then begin
1227 Msg:='Line
{#__LINE__}: Unable
to revert any possible changes
to SVN_SSH
.';
1228 MsgBox(Msg,mbError,MB_OK);
1230 // This is not a critical error, the user can probably fix it manually,
1235 // Get the current user's directories
in PATH
.
1236 EnvPath
:=GetEnvStrings('PATH',IsAdminLoggedOn
);
1238 // Remove the installation directory from PATH
in any
case, even
if it
1239 // was
not added by the installer
.
1240 for i
:=0 to GetArrayLength(EnvPath
)-1 do begin
1241 if Pos(AppDir
+'\',EnvPath[i]+'\')=1 then begin
1246 // Reset the current user
's directories in PATH.
1247 if not SetEnvStrings('PATH
',IsAdminLoggedOn,True,EnvPath) then begin
1248 Msg:='Line
{#__LINE__}: Unable
to revert any possible changes
to PATH
.';
1249 MsgBox(Msg,mbError,MB_OK);
1251 // This is not a critical error, the user can probably fix it manually,
1255 // Reset the current user's HOME
if we modified it
.
1256 EnvHome
:=GetEnvStrings('HOME',IsAdminLoggedOn
);
1257 if (GetArrayLength(EnvHome
)=1) and
1258 (CompareStr(RemoveQuotes(EnvHome
[0]),GetIniString('Environment','HOME','',FileName
))=0) then begin
1259 if not SetEnvStrings('HOME',IsAdminLoggedOn
,True,[]) then begin
1260 Msg
:='Line {#__LINE__}: Unable to revert any possible changes to HOME.';
1261 MsgBox(Msg
,mbError
,MB_OK
);
1263 // This
is not a critical error
, the user can probably fix it manually
,
1268 if FileExists(FileName
) and (not DeleteFile(FileName
)) then begin
1269 Msg
:='Line {#__LINE__}: Unable to delete file "'+FileName
+'".';
1270 MsgBox(Msg
,mbError
,MB_OK
);
1272 // This
is not a critical error
, the user can probably fix it manually
,
1277 Delete the Windows Explorer integrations
1280 DeleteContextMenuEntries
;
1282 FileName
:=AppDir
+'\git-cheetah\git_shell_ext.dll';
1283 if FileExists(FileName
) then begin
1284 if not UnregisterServer(Is64BitInstallMode
,FileName
,False) then begin
1285 Msg
:='Line {#__LINE__}: Unable to unregister file "'+FileName
+'". Please do it manually by running "regsvr32 /u '+ExtractFileName(FileName
)+'".';
1286 MsgBox(Msg
,mbError
,MB_OK
);
1290 if not DeleteFile(FileName
) then begin
1291 Msg
:='Line {#__LINE__}: Unable to delete file "'+FileName
+'". Please do it manually after logging off and on again.';
1292 MsgBox(Msg
,mbError
,MB_OK
);