Skip to content

Commit 2b1191c

Browse files
committed
ScpVBus Install / Uninstall via menu
1 parent d3eee5d commit 2b1191c

File tree

9 files changed

+120
-4
lines changed

9 files changed

+120
-4
lines changed

Changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Key:
44
= : Change / Fix
55
+ : Added feature
66

7+
0.1.2 - 11th Oct 2016
8+
= Fix: vXBox Buttons can now be selected in the OutputButton control.
9+
+ ScpVBus (Required for vXBox) now packaged with UCR.
10+
I will probably put in a download routine at some point
11+
But this will do as a stop-gap
12+
+ ScpVBus can be installed / uninstalled from within UCR via the IOClasses > vJoy menu.
13+
714
0.1.1 - 9th Oct 2016
815
+ Re-Added Titan One API
916

Classes/GuiControls/IOClasses/vGen.ahk

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class vGen_Output extends _UCR.Classes.IOClasses.IOClassBase {
3535
static _POVStates := {}
3636

3737
UCRMenuOutput := {}
38+
ScpVBusInstalled := 0
3839

3940
_Init(){
4041
if (_UCR.Classes.IOClasses.vGen_Output.IsInitialized)
@@ -43,8 +44,8 @@ class vGen_Output extends _UCR.Classes.IOClasses.IOClassBase {
4344
this.UCRMenuEntry.AddMenuItem("Show &vJoy Log...", "ShowvJoyLog", this.ShowvJoyLog.Bind(this))
4445
this.UCRMenuOutput.vJoyInstalled := this.UCRMenuEntry.AddMenuItem("vJoy Installed (Required)", "vJoyInstalled").Disable()
4546
this.UCRMenuOutput.SCPVBusInstalled := this.UCRMenuEntry.AddMenuItem("SCPVBus Installed (Required for vXBox)", "SCPVBusInstalled").Disable()
46-
this.UCRMenuOutput.InstallSCPVBus := this.UCRMenuEntry.AddMenuItem("Install SCPVBus", "InstallSCPVBus").Disable()
47-
this.UCRMenuOutput.UninstallSCPVBus := this.UCRMenuEntry.AddMenuItem("Uninstall SCPVBus", "UninstallSCPVBus").Disable()
47+
this.UCRMenuOutput.InstallSCPVBus := this.UCRMenuEntry.AddMenuItem("Install SCPVBus (Will Restart UCR)", "InstallSCPVBus", this.InstallUninstallScpVBus.Bind(this,1)).Disable()
48+
this.UCRMenuOutput.UninstallSCPVBus := this.UCRMenuEntry.AddMenuItem("Uninstall SCPVBus (Will Restart UCR)", "UninstallSCPVBus", this.InstallUninstallScpVBus.Bind(this,0)).Disable()
4849
this._LoadLibrary()
4950

5051
_UCR.Classes.IOClasses.vGen_Output._POVStates.vJoy_Hat_Output := [[{x:0, y: 0},{x:0, y: 0},{x:0, y: 0},{x:0, y: 0}]
@@ -129,7 +130,7 @@ class vGen_Output extends _UCR.Classes.IOClasses.IOClassBase {
129130
} else {
130131
this.LoadLibraryLog .= "SCPVBus is not installed (Non fatal)`n"
131132
}
132-
this.UCRMenuOutput.SCPVBusInstalled.SetCheckState(vb)
133+
this.SetScpVBusState(vb)
133134
this._SetInitState(hModule)
134135
return 1
135136
} else {
@@ -160,6 +161,30 @@ class vGen_Output extends _UCR.Classes.IOClasses.IOClassBase {
160161
msgbox % this.LoadLibraryLog "`n`nThis information has been copied to the clipboard"
161162
}
162163

164+
InstallUninstallScpVBus(state){
165+
if (state == this.ScpVBusInstalled)
166+
return
167+
if (state){
168+
RunWait, *Runas devcon.exe install ScpVBus.inf root\ScpVBus, % A_ScriptDir "\Resources\ScpVBus", UseErrorLevel
169+
} else {
170+
RunWait, *Runas devcon.exe remove root\ScpVBus, % A_ScriptDir "\Resources\ScpVBus", UseErrorLevel
171+
}
172+
if (ErrorLevel == "ERROR")
173+
return 0
174+
Reload
175+
;~ ex := this.IsVBusExist()
176+
;~ if (ex != state)
177+
;~ return 0
178+
;~ this.SetScpVBusState(state)
179+
;~ return 1
180+
}
181+
182+
SetScpVBusState(state){
183+
this.UCRMenuOutput.InstallSCPVBus.SetEnableState(!state)
184+
this.UCRMenuOutput.UninstallSCPVBus.SetEnableState(state)
185+
this.ScpVBusInstalled := state
186+
this.UCRMenuOutput.SCPVBusInstalled.SetCheckState(state)
187+
}
163188

164189
SetButtonState(state){
165190
; DWORD SetDevButton(HDEVICE hDev, UINT Button, BOOL Press);

Classes/UCRMain.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; ======================================================================== MAIN CLASS ===============================================================
22
Class _UCR {
3-
Version := "0.1.1" ; The version of the main application
3+
Version := "0.1.2" ; The version of the main application
44
SettingsVersion := "0.0.6" ; The version of the settings file format
55
_StateNames := {0: "Normal", 1: "InputBind", 2: "GameBind"}
66
_State := {Normal: 0, InputBind: 1, GameBind: 2}

Resources/ScpVBus/ScpVBus.inf

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
;
2+
; ScpVBus.inf
3+
;
4+
5+
[Version]
6+
Signature="$WINDOWS NT$"
7+
Class=System
8+
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}
9+
Provider=%ManufacturerName%
10+
CatalogFile=ScpVBus.cat
11+
DriverVer=08/06/2016,20.13.1.308
12+
13+
[DestinationDirs]
14+
DefaultDestDir = 12
15+
16+
; ================= Class section =====================
17+
18+
[SourceDisksNames]
19+
1 = %DiskName%,,,""
20+
21+
[SourceDisksFiles]
22+
ScpVBus.sys = 1,,
23+
24+
;*****************************************
25+
; Install Section
26+
;*****************************************
27+
28+
[Manufacturer]
29+
%ManufacturerName%=SCProductions,NTamd64
30+
31+
[SCProductions.NTamd64]
32+
%ScpVBus.DeviceDesc%=ScpVBus_Device, Root\ScpVBus
33+
34+
[ScpVBus_Device.NT]
35+
CopyFiles=Drivers_Dir
36+
37+
[Drivers_Dir]
38+
ScpVBus.sys
39+
40+
;-------------- Service installation
41+
[ScpVBus_Device.NT.Services]
42+
AddService = ScpVBus,%SPSVCINST_ASSOCSERVICE%, ScpVBus_Service_Inst
43+
44+
; -------------- ScpVBus driver install sections
45+
[ScpVBus_Service_Inst]
46+
DisplayName = %ScpVBus.SVCDESC%
47+
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
48+
StartType = 3 ; SERVICE_DEMAND_START
49+
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
50+
ServiceBinary = %12%\ScpVBus.sys
51+
52+
;
53+
;--- ScpVBus_Device Coinstaller installation ------
54+
;
55+
56+
[DestinationDirs]
57+
ScpVBus_Device_CoInstaller_CopyFiles = 11
58+
59+
[ScpVBus_Device.NT.CoInstallers]
60+
AddReg=ScpVBus_Device_CoInstaller_AddReg
61+
CopyFiles=ScpVBus_Device_CoInstaller_CopyFiles
62+
63+
[ScpVBus_Device_CoInstaller_AddReg]
64+
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01009.dll,WdfCoInstaller"
65+
66+
[ScpVBus_Device_CoInstaller_CopyFiles]
67+
WdfCoInstaller01009.dll
68+
69+
[SourceDisksFiles]
70+
WdfCoInstaller01009.dll=1 ; make sure the number matches with SourceDisksNames
71+
72+
[ScpVBus_Device.NT.Wdf]
73+
KmdfService = ScpVBus, ScpVBus_wdfsect
74+
[ScpVBus_wdfsect]
75+
KmdfLibraryVersion = 1.9
76+
77+
[Strings]
78+
SPSVCINST_ASSOCSERVICE= 0x00000002
79+
ManufacturerName="Nefarius Software Solutions"
80+
DiskName = "Scp Virtual Bus Installation Media"
81+
ScpVBus.DeviceDesc = "Scp Virtual Bus Driver"
82+
ScpVBus.SVCDESC = "Scp Virtual Bus Driver"

Resources/ScpVBus/ScpVBus.sys

43 KB
Binary file not shown.
1.64 MB
Binary file not shown.

Resources/ScpVBus/install.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@devcon.exe install ScpVBus.inf root\ScpVBus

Resources/ScpVBus/scpvbus.cat

8.86 KB
Binary file not shown.

Resources/ScpVBus/uninstall.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@devcon.exe remove root\ScpVBus

0 commit comments

Comments
 (0)