msg1 := MsgBox('Node '+NodeVersion+' is already installed. Do you want NVM to control this version?', mbConfirmation, MB_YESNO) = IDNO;
if msg1 then begin
msg2 := MsgBox('NVM cannot run in parallel with an existing Node.js installation. Node.js must be uninstalled before NVM can be installed, or you must allow NVM to control the existing installation. Do you want NVM to control node '+NodeVersion+'?', mbConfirmation, MB_YESNO) = IDYES;
if msg2 then begin
TakeControl(NodePath, NodeVersion);
end;
if not msg2 then begin
DeleteFile(TmpResultFile);
WizardForm.Close;
end;
end;
if not msg1 then
begin
TakeControl(NodePath, NodeVersion);
end;
end;
// Make sure the symlink directory doesn't exist
if DirExists(SymlinkPage.Values[0]) then begin
// If the directory is empty, just delete it since it will be recreated anyway.
dir1 := IsDirEmpty(SymlinkPage.Values[0]);
if dir1 then begin
RemoveDir(SymlinkPage.Values[0]);
end;
if not dir1 then begin
msg3 := MsgBox(SymlinkPage.Values[0]+' will be overwritten and all contents will be lost. Do you want to proceed?', mbConfirmation, MB_OKCANCEL) = IDOK;
if msg3 then begin
RemoveDir(SymlinkPage.Values[0]);
end;
if not msg3 then begin
//RaiseException('The symlink cannot be created due to a conflict with the existing directory at '+SymlinkPage.Values[0]);
WizardForm.Close;
end;
end;
end;
end;
procedure InitializeWizard;
begin
SymlinkPage := CreateInputDirPage(wpSelectDir,
...
...
@@ -56,7 +183,7 @@ begin
'Select the folder in which Setup should create the symlink, then click Next.',
False, '');
SymlinkPage.Add('This directory will automatically be added to your system path.');