From ef260b9d2d2325d27db10843c3ddce85f88464fd Mon Sep 17 00:00:00 2001 From: Alessandro Menezes Date: Fri, 6 Jan 2017 13:32:50 -0300 Subject: [PATCH] Finishing setup implementation --- .../DriverInstaller-x64.vdproj | 712 ------------------ DriverInstaller/DriverInstaller.vdproj | 146 ++-- GenericFFBDriver/GenericFFBDriver.vcxproj | 3 + .../GenericFFBDriver.vcxproj.filters | 3 + .../VibrationDriverRegistration.cpp | 125 +++ GenericFFBDriver/genericFFBDriver.def | 7 +- GenericFFBDriver/stdafx.h | 1 - Joypad.sln | 12 - 8 files changed, 211 insertions(+), 798 deletions(-) delete mode 100644 DriverInstaller-x64/DriverInstaller-x64.vdproj create mode 100644 GenericFFBDriver/VibrationDriverRegistration.cpp diff --git a/DriverInstaller-x64/DriverInstaller-x64.vdproj b/DriverInstaller-x64/DriverInstaller-x64.vdproj deleted file mode 100644 index 2f1cad4..0000000 --- a/DriverInstaller-x64/DriverInstaller-x64.vdproj +++ /dev/null @@ -1,712 +0,0 @@ -"DeployProject" -{ -"VSVersion" = "3:800" -"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" -"IsWebType" = "8:FALSE" -"ProjectName" = "8:DriverInstaller-x64" -"LanguageId" = "3:1033" -"CodePage" = "3:1252" -"UILanguageId" = "3:1033" -"SccProjectName" = "8:" -"SccLocalPath" = "8:" -"SccAuxPath" = "8:" -"SccProvider" = "8:" - "Hierarchy" - { - "Entry" - { - "MsmKey" = "8:_084F3146332A4822A98EEB30C6322AF9" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_26E5944F94BC45468B7248E7960A4BB0" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - } - "Configurations" - { - "Debug" - { - "DisplayName" = "8:Debug" - "IsDebugOnly" = "11:TRUE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\DriverInstaller-x64.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - } - "Release" - { - "DisplayName" = "8:Release" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:..\\Release\\VibrationDriverInstaller-x64.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - } - } - } - } - "Deployable" - { - "CustomAction" - { - } - "DefaultFeature" - { - "Name" = "8:DefaultFeature" - "Title" = "8:" - "Description" = "8:" - } - "ExternalPersistence" - { - "LaunchCondition" - { - } - } - "File" - { - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_084F3146332A4822A98EEB30C6322AF9" - { - "SourcePath" = "8:..\\Release\\GenericFFBDriver64.dll" - "TargetName" = "8:GenericFFBDriver64.dll" - "Tag" = "8:" - "Folder" = "8:_075BB8087B894FF7977227C741A486E1" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:4" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_26E5944F94BC45468B7248E7960A4BB0" - { - "SourcePath" = "8:..\\Release\\GenericFFBDriver32.dll" - "TargetName" = "8:GenericFFBDriver32.dll" - "Tag" = "8:" - "Folder" = "8:_075BB8087B894FF7977227C741A486E1" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:4" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - } - "FileType" - { - } - "Folder" - { - "{1525181F-901A-416C-8A58-119130FE478E}:_02AA7C775F924A1692AD127715C38500" - { - "Name" = "8:#1916" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:DesktopFolder" - "Folders" - { - } - } - "{3C67513D-01DD-4637-8A68-80971EB9504F}:_075BB8087B894FF7977227C741A486E1" - { - "DefaultLocation" = "8:[ProgramFiles64Folder][Manufacturer]\\[ProductName]" - "Name" = "8:#1925" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:TARGETDIR" - "Folders" - { - } - } - "{1525181F-901A-416C-8A58-119130FE478E}:_95F4E9C9B02C4C8CB96E88517E519151" - { - "Name" = "8:#1919" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:ProgramMenuFolder" - "Folders" - { - } - } - } - "LaunchCondition" - { - } - "Locator" - { - } - "MsiBootstrapper" - { - "LangId" = "3:1033" - "RequiresElevation" = "11:FALSE" - } - "Product" - { - "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:DriverInstaller-x64" - "ProductCode" = "8:{4A8A8662-6457-43D5-BAC7-7DD718845D4E}" - "PackageCode" = "8:{95CE233C-51D8-4DBA-B4DA-730D82614ED8}" - "UpgradeCode" = "8:{C0BAF746-2A79-49D2-A1FD-0C0D5D1A2D93}" - "AspNetVersion" = "8:4.0.30319.0" - "RestartWWWService" = "11:FALSE" - "RemovePreviousVersions" = "11:FALSE" - "DetectNewerInstalledVersion" = "11:TRUE" - "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:1.0.0" - "Manufacturer" = "8:Alessandro Menezes" - "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:" - "Title" = "8:Generic USB Gamepad Vibration Driver" - "Subject" = "8:" - "ARPCONTACT" = "8:Alessandro Menezes" - "Keywords" = "8:" - "ARPCOMMENTS" = "8:Generic USB Gamepad Vibration Driver" - "ARPURLINFOABOUT" = "8:" - "ARPPRODUCTICON" = "8:" - "ARPIconIndex" = "3:0" - "SearchPath" = "8:" - "UseSystemSearchPath" = "11:TRUE" - "TargetPlatform" = "3:1" - "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:" - "RunPostBuildEvent" = "3:0" - } - "Registry" - { - "HKLM" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_59B079425F3743059F27D9517438B47C" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_10AAD0D8FF3541969B3BFB97B7B5CBFF" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCU" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_0747C7195F394423BE4EE57FF7FDD20C" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C28B484230C74BDA9C60578CED7FD89A" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCR" - { - "Keys" - { - } - } - "HKU" - { - "Keys" - { - } - } - "HKPU" - { - "Keys" - { - } - } - } - "Sequences" - { - } - "Shortcut" - { - } - "UserInterface" - { - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_2751836D3E6F422683581A99DF770EDB" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdUserInterface.wim" - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_40462641E2A84CA593E01BBC53D5DB57" - { - "Name" = "8:#1901" - "Sequence" = "3:2" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_69B9E54F400346F581BA646ECC2AFBF9" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_45CDA0DA769D4D6B93400119EB6BFC25" - { - "Name" = "8:#1902" - "Sequence" = "3:2" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9E2F77B47DDF402C943DF6D9ABD0A12E" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_542A3621EE0749CAB1B9390E4274C0F6" - { - "Name" = "8:#1901" - "Sequence" = "3:1" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_0FDE13EEA845458A8833FFB921A1D02A" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_5E3E25C8AF5C4E0EA904C900AE038FEB" - { - "Name" = "8:#1902" - "Sequence" = "3:1" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_565559DF872F4B869C5E9C9C7FCFBA54" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "UpdateText" - { - "Name" = "8:UpdateText" - "DisplayName" = "8:#1058" - "Description" = "8:#1158" - "Type" = "3:15" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1258" - "DefaultValue" = "8:#1258" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_7574E02287594D049933F4203BFECAC3" - { - "Name" = "8:#1900" - "Sequence" = "3:1" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_11833C57DAC740CC80DBC57197B2E746" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9AE84F3BFF7F4250AC11E915827E8F00" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "InstallAllUsersVisible" - { - "Name" = "8:InstallAllUsersVisible" - "DisplayName" = "8:#1059" - "Description" = "8:#1159" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_FAF3CA12B54740EDADBACE979FEE7F23" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_7629C4A85CEE486793695974A1B64341" - { - "Name" = "8:#1900" - "Sequence" = "3:2" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_29D1E4FAD54F4DF596F672826C4D2E0C" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7614AC757D64409884663817FC8175A9" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C818260762BD48A1AC5B2EBDAE3A8BEE" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_EBC2CAFB411F41768EFFFCC6296EB556" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdBasicDialogs.wim" - } - } - "MergeModule" - { - } - "ProjectOutput" - { - } - } -} diff --git a/DriverInstaller/DriverInstaller.vdproj b/DriverInstaller/DriverInstaller.vdproj index 818819e..acc2e47 100644 --- a/DriverInstaller/DriverInstaller.vdproj +++ b/DriverInstaller/DriverInstaller.vdproj @@ -3,7 +3,7 @@ "VSVersion" = "3:800" "ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" "IsWebType" = "8:FALSE" -"ProjectName" = "8:DriverInstaller-x86" +"ProjectName" = "8:DriverInstaller" "LanguageId" = "3:1033" "CodePage" = "3:1252" "UILanguageId" = "3:1033" @@ -13,6 +13,12 @@ "SccProvider" = "8:" "Hierarchy" { + "Entry" + { + "MsmKey" = "8:_C378259A8D8C4FB880EAEC27ECC1720F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } "Entry" { "MsmKey" = "8:_CACB481DB8B74D96B26F50DCA0C3F56A" @@ -27,7 +33,7 @@ "DisplayName" = "8:Debug" "IsDebugOnly" = "11:TRUE" "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\DriverInstaller.msi" + "OutputFilename" = "8:..\\Release\\VibrationDriverInstaller.msi" "PackageFilesAs" = "3:2" "PackageFileSize" = "3:-2147483648" "CabType" = "3:1" @@ -37,13 +43,21 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } } "Release" { "DisplayName" = "8:Release" "IsDebugOnly" = "11:FALSE" "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:..\\Release\\VibrationDriverInstaller-x86.msi" + "OutputFilename" = "8:..\\Release\\VibrationDriverInstaller.msi" "PackageFilesAs" = "3:2" "PackageFileSize" = "3:-2147483648" "CabType" = "3:1" @@ -70,6 +84,20 @@ { "CustomAction" { + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_A58FBA840C67404E868C9D92987CA01A" + { + "Name" = "8:GenericFFBDriver32.dll" + "Condition" = "8:" + "Object" = "8:_CACB481DB8B74D96B26F50DCA0C3F56A" + "FileType" = "3:1" + "InstallAction" = "3:1" + "Arguments" = "8:" + "EntryPoint" = "8:RegisterVibrationDriver" + "Sequence" = "3:1" + "Identifier" = "8:_E9FCB57E_3CD7_4256_8EE5_1BFB7014D07D" + "InstallerClass" = "11:FALSE" + "CustomActionData" = "8:" + } } "DefaultFeature" { @@ -85,12 +113,32 @@ } "File" { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C378259A8D8C4FB880EAEC27ECC1720F" + { + "SourcePath" = "8:..\\Release\\GenericFFBDriver64.dll" + "TargetName" = "8:GenericFFBDriver64.dll" + "Tag" = "8:" + "Folder" = "8:_08365EDD8FF742F7A8EA90AD36CEE015" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CACB481DB8B74D96B26F50DCA0C3F56A" { "SourcePath" = "8:..\\Release\\GenericFFBDriver32.dll" "TargetName" = "8:GenericFFBDriver32.dll" "Tag" = "8:" - "Folder" = "8:_70D2A39DB17244D1A08BF53BE196346B" + "Folder" = "8:_08365EDD8FF742F7A8EA90AD36CEE015" "Condition" = "8:" "Transitive" = "11:FALSE" "Vital" = "11:TRUE" @@ -145,16 +193,31 @@ { } } + "{1525181F-901A-416C-8A58-119130FE478E}:_EB20EB274A8046AEA4621B3A08C74E43" + { + "Name" = "8:#1924" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:WindowsFolder" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_08365EDD8FF742F7A8EA90AD36CEE015" + { + "Name" = "8:GenericFFBDriver" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_C4024A52445545BFAFDC66ED44DCA719" + "Folders" + { + } + } + } + } } "LaunchCondition" { - "{836E08B8-0285-4809-BA42-01DB6754A45D}:_CE465BB9F91247E294E9C0235D4ECCAC" - { - "Name" = "8:Machine_is_x64" - "Condition" = "8:!VersionNT64" - "Message" = "8:Please install the x64 driver" - "InstallUrl" = "8:" - } } "Locator" { @@ -169,7 +232,7 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Generic USB Gamepad Vibration Driver" "ProductCode" = "8:{50CD8B4D-CD82-49D1-9E0A-2B7887448068}" - "PackageCode" = "8:{9637050A-F0CF-4529-95D3-3BD9C8410FAB}" + "PackageCode" = "8:{C6059427-7868-44F2-86B6-E029402B5181}" "UpgradeCode" = "8:{A08375A2-DC94-4A88-8431-ED8D9717FA62}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" @@ -177,7 +240,7 @@ "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" "ProductVersion" = "8:1.0.0" - "Manufacturer" = "8:Alessandro Menezes" + "Manufacturer" = "8:Generic USB Gamepad Vibration Driver" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" "Title" = "8:Generic USB Gamepad Vibration Driver" @@ -494,28 +557,6 @@ } } } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F2DB315D6C9C45D2BEFEDAE1DE489358" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdAdminFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } } } "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_781D1A01A61242E48BB1652DE8A42A73" @@ -575,41 +616,6 @@ "Attributes" = "3:1" "Dialogs" { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_D2E3044385814E558FB3996F30200A15" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:\\VsdFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "InstallAllUsersVisible" - { - "Name" = "8:InstallAllUsersVisible" - "DisplayName" = "8:#1059" - "Description" = "8:#1159" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DD51DDF859CE471FA216BD8D94DC9BF2" { "Sequence" = "3:300" diff --git a/GenericFFBDriver/GenericFFBDriver.vcxproj b/GenericFFBDriver/GenericFFBDriver.vcxproj index 2a7b45f..1dcd0e3 100644 --- a/GenericFFBDriver/GenericFFBDriver.vcxproj +++ b/GenericFFBDriver/GenericFFBDriver.vcxproj @@ -94,6 +94,7 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug Windows @@ -127,6 +128,7 @@ true true WIN32;NDEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded Windows @@ -189,6 +191,7 @@ + diff --git a/GenericFFBDriver/GenericFFBDriver.vcxproj.filters b/GenericFFBDriver/GenericFFBDriver.vcxproj.filters index 95b383d..a98a890 100644 --- a/GenericFFBDriver/GenericFFBDriver.vcxproj.filters +++ b/GenericFFBDriver/GenericFFBDriver.vcxproj.filters @@ -62,6 +62,9 @@ Source Files + + Source Files + diff --git a/GenericFFBDriver/VibrationDriverRegistration.cpp b/GenericFFBDriver/VibrationDriverRegistration.cpp new file mode 100644 index 0000000..135e9bb --- /dev/null +++ b/GenericFFBDriver/VibrationDriverRegistration.cpp @@ -0,0 +1,125 @@ +#include "stdafx.h" +#include +#include + +#define DRIVER_x86 "GenericFFBDriver32.dll" +#define DRIVER_x64 "GenericFFBDriver64.dll" + +#ifdef _WIN64 +#define IS_WIN64 TRUE +#else +#define IS_WIN64 IsWow64() +#endif + +typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); +LPFN_ISWOW64PROCESS fnIsWow64Process; + +typedef UINT(WINAPI *LPFN_GETSYSTEMWOW64DIRECTORY) (LPSTR, UINT); +LPFN_GETSYSTEMWOW64DIRECTORY fnGetSystemWow64Directory; + +BOOL IsWow64() +{ + BOOL bIsWow64 = FALSE; + + //IsWow64Process is not available on all supported versions of Windows. + //Use GetModuleHandle to get a handle to the DLL that contains the function + //and GetProcAddress to get a pointer to the function if available. + + fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress( + GetModuleHandle(TEXT("kernel32")), "IsWow64Process"); + + if (NULL != fnIsWow64Process) + { + if (!fnIsWow64Process(GetCurrentProcess(), &bIsWow64)) { + HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); + + _ASSERT(hr == S_OK); + } + } + return bIsWow64; +} + + +int RunCommand(LPSTR cmd) { + STARTUPINFOA si; + PROCESS_INFORMATION pi; + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + ZeroMemory(&pi, sizeof(pi)); + + // Start the child process. + if (!CreateProcessA(NULL, // No module name (use command line) + cmd, // Command line + NULL, // Process handle not inheritable + NULL, // Thread handle not inheritable + FALSE, // Set handle inheritance to FALSE + 0, // No creation flags + NULL, // Use parent's environment block + NULL, // Use parent's starting directory + &si, // Pointer to STARTUPINFO structure + &pi) // Pointer to PROCESS_INFORMATION structure + ) + { + printf("CreateProcess failed (%d).\n", GetLastError()); + return FALSE; + } + + // Wait until child process exits. + WaitForSingleObject(pi.hProcess, INFINITE); + + // Close process and thread handles. + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + return TRUE; +} + +STDAPI RegisterVibrationDriver(void) { + BOOL isWin64 = IS_WIN64; + char systemPath[MAX_PATH]; + char cmdLine[MAX_PATH]; + char modulePath[MAX_PATH]; + + // Finding dll directory + strcpy_s(modulePath, ""); + + HMODULE hModule = GetModuleHandleA(DRIVER_x86); + if (hModule == NULL) + hModule = GetModuleHandleA(DRIVER_x64); + + if (hModule != NULL) { + if (GetModuleFileNameA(hModule, modulePath, MAX_PATH) > 0) { + + char tmpBuffer[MAX_PATH]; + sprintf_s(tmpBuffer, "%s\\..\\", modulePath); + + GetFullPathNameA(tmpBuffer, MAX_PATH, modulePath, NULL); + } + } + + if (isWin64) { + // Must register both x86 and x64 dlls + + // x64 registration + GetSystemDirectoryA(systemPath, MAX_PATH); + sprintf_s(cmdLine, "\"%s\\regsvr32.exe\" /s \"%s%s\"", systemPath, modulePath, DRIVER_x64); + RunCommand(cmdLine); + + // x86 registration + fnGetSystemWow64Directory = (LPFN_GETSYSTEMWOW64DIRECTORY)GetProcAddress( + GetModuleHandleA("kernel32"), "GetSystemWow64DirectoryA"); + fnGetSystemWow64Directory(systemPath, MAX_PATH); + sprintf_s(cmdLine, "\"%s\\regsvr32.exe\" /s \"%s%s\"", systemPath, modulePath, DRIVER_x86); + RunCommand(cmdLine); + } + else { + // Register x86 only + GetSystemDirectoryA(systemPath, MAX_PATH); + sprintf_s(cmdLine, "\"%s\\regsvr32.exe\" /s \"%s%s\"", systemPath, modulePath, DRIVER_x64); + RunCommand(cmdLine); + + } + + return S_OK; +} diff --git a/GenericFFBDriver/genericFFBDriver.def b/GenericFFBDriver/genericFFBDriver.def index 7c13e0f..b9f588e 100644 --- a/GenericFFBDriver/genericFFBDriver.def +++ b/GenericFFBDriver/genericFFBDriver.def @@ -1,11 +1,12 @@ -;myServ.def : Declares the module parameters for the DLL. +;genericFFBDriver.def : Declares the module parameters for the DLL. -LIBRARY myServ -DESCRIPTION 'My First total C++ COM Object' +;LIBRARY genericFFBDriver +;DESCRIPTION 'Generic USB Gamepad Vibration driver' EXPORTS DllRegisterServer PRIVATE ; COM server registration DllUnregisterServer PRIVATE ; COM server deregistration DllCanUnloadNow PRIVATE DllGetClassObject PRIVATE + RegisterVibrationDriver PRIVATE diff --git a/GenericFFBDriver/stdafx.h b/GenericFFBDriver/stdafx.h index deaf97b..ac0cc7d 100644 --- a/GenericFFBDriver/stdafx.h +++ b/GenericFFBDriver/stdafx.h @@ -12,7 +12,6 @@ #include - // TODO: reference additional headers your program requires here #define DIRECTINPUT_VERSION 0x0800 #include diff --git a/Joypad.sln b/Joypad.sln index bc3be84..4337d6c 100644 --- a/Joypad.sln +++ b/Joypad.sln @@ -7,8 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GenericFFBDriver", "Generic EndProject Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "DriverInstaller-x86", "DriverInstaller\DriverInstaller.vdproj", "{C408790E-C9A8-4E4E-866F-F29991472631}" EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "DriverInstaller-x64", "DriverInstaller-x64\DriverInstaller-x64.vdproj", "{7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -47,16 +45,6 @@ Global {C408790E-C9A8-4E4E-866F-F29991472631}.ReleaseSetup|x64.ActiveCfg = Release {C408790E-C9A8-4E4E-866F-F29991472631}.ReleaseSetup|x64.Build.0 = Release {C408790E-C9A8-4E4E-866F-F29991472631}.ReleaseSetup|x86.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Debug|Any CPU.ActiveCfg = Debug - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Debug|x64.ActiveCfg = Debug - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Debug|x86.ActiveCfg = Debug - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Release|Any CPU.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Release|x64.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.Release|x86.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.ReleaseSetup|Any CPU.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.ReleaseSetup|x64.ActiveCfg = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.ReleaseSetup|x64.Build.0 = Release - {7E5C5724-8FFB-47FF-B1CC-6D29BD624D0A}.ReleaseSetup|x86.ActiveCfg = Release EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE