@@ -8,16 +8,18 @@ interface
88
99type
1010 TMain = class (TForm)
11- ApplyBtn : TButton;
11+ InstallBtn : TButton;
1212 CancelBtn: TButton;
1313 AboutBtn: TButton;
1414 XPManifest: TXPManifest;
1515 DbgMdCb: TCheckBox;
1616 DbgMdLbl: TLabel;
17+ UninstallBtn: TButton;
1718 procedure FormCreate (Sender: TObject);
1819 procedure AboutBtnClick (Sender: TObject);
19- procedure ApplyBtnClick (Sender: TObject);
20+ procedure InstallBtnClick (Sender: TObject);
2021 procedure CancelBtnClick (Sender: TObject);
22+ procedure UninstallBtnClick (Sender: TObject);
2123 private
2224 { Private declarations }
2325 public
@@ -26,15 +28,26 @@ TMain = class(TForm)
2628
2729var
2830 Main: TMain;
31+ SteamPath: string;
2932
3033implementation
3134
3235{ $R *.dfm}
3336
3437procedure TMain.FormCreate (Sender: TObject);
38+ var
39+ Reg: TRegistry;
3540begin
3641 Application.Title:=Caption;
3742
43+ Reg:=TRegistry.Create;
44+ // Steam
45+ Reg.RootKey:=HKEY_CURRENT_USER;
46+ if (Reg.OpenKey(' \Software\Valve\Steam' , false)) then
47+ SteamPath:=StringReplace(Reg.ReadString(' SteamPath' ), ' /' , ' \' , [rfReplaceAll]);
48+ Reg.CloseKey;
49+ Reg.Free;
50+
3851 DbgMdLbl.Caption:=DbgMdLbl.Caption + #13 #10 + ' Windowed borderless fullscreen' + #13 #10 + ' with lock to 30 FPS' ;
3952end ;
4053
@@ -45,24 +58,18 @@ procedure TMain.AboutBtnClick(Sender: TObject);
4558 ' [email protected] ' , PChar(Caption), MB_ICONINFORMATION);
4659end ;
4760
48- procedure TMain.ApplyBtnClick (Sender: TObject);
61+ procedure TMain.InstallBtnClick (Sender: TObject);
4962var
5063 Reg: TRegistry;
51- SteamPath: string;
5264 Config: TStringList;
5365 Error: boolean;
5466
5567 RenderWidth, RenderHeight, ScreenIndex: integer;
5668 IPD, DistortionK1, DistortionK2: double;
5769begin
5870 Error:=false;
59- Reg:=TRegistry.Create;
60- // Steam
61- Reg.RootKey:=HKEY_CURRENT_USER;
62- if (Reg.OpenKey(' \Software\Valve\Steam' , false)) then
63- SteamPath:=StringReplace(Reg.ReadString(' SteamPath' ), ' /' , ' \' , [rfReplaceAll]);
64- Reg.CloseKey;
6571
72+ Reg:=TRegistry.Create;
6673 // TrueOpenVR
6774 Reg.RootKey:=HKEY_CURRENT_USER;
6875 if Reg.OpenKey(' \Software\TrueOpenVR' , false) then begin
@@ -133,7 +140,7 @@ procedure TMain.ApplyBtnClick(Sender: TObject);
133140 end ;
134141
135142 if Error = false then
136- Application.MessageBox(' Done ' , PChar(Caption), MB_ICONINFORMATION);
143+ Application.MessageBox(' Installed ' , PChar(Caption), MB_ICONINFORMATION);
137144
138145 end else
139146 Application.MessageBox(' Steam not found. Please install Steam and SteamVR' , PChar(Caption), MB_ICONERROR);
@@ -147,4 +154,14 @@ procedure TMain.CancelBtnClick(Sender: TObject);
147154 Close;
148155end ;
149156
157+ procedure TMain.UninstallBtnClick (Sender: TObject);
158+ begin
159+ if DirectoryExists(SteamPath) then begin
160+ if FileExists(SteamPath + ' \config\steamvr.vrsettings' ) then
161+ DeleteFile(SteamPath + ' \config\steamvr.vrsettings' );
162+ Application.MessageBox(' Uninstalled' , PChar(Caption), MB_ICONINFORMATION);
163+ end else
164+ Application.MessageBox(' Steam not found. Please install Steam and SteamVR' , PChar(Caption), MB_ICONERROR);
165+ end ;
166+
150167end .
0 commit comments