riverar / uxstyle

GNU General Public License v3.0
291 stars 37 forks source link

Code signing during UXStyle building #40

Closed momashi closed 7 years ago

momashi commented 7 years ago

The fuzzy step by step instructions for building uxstyle says that once the service and driver files have been compile, we need to leave VS2013 and sign these files manually.

I'm on Windows 7. If I understand correctly, my options are to either subscribe to paid cirtificate to sign the driver or test sign my files and run Windows in test mode. Is this correct or is there another way of getting these files signed without having to go to through the test signing route or the pay route?

Also, the instructions said to select a Windows 8 release during compilation. Should I select Windows 7 or would the Windows 8 release work for me too?

riverar commented 7 years ago

You're correct, you have to sign the drivers with a prod or test cert. I don't remember if the codebase still supports Windows 7 -- that OS is EOL -- but should work via the Win7 Release option.

momashi commented 7 years ago

It's been pretty smooth sailing, except for this one issue I'm having with compiling the bundle. I'm getting this error:

Error 2 The command ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\signtool.exe" sign /n "The Within Network, LLC" /t http://timestamp.verisign.com/scripts/timestamp.dll /v "obj\x64\Release\UxStyle_Bundle.exe"" exited with code 9009. C:\Users\Boo\Desktop\uxstyle-master\code\bundle\bundle.wixproj 94

Any idea what could be wrong?

momashi commented 7 years ago

I got it to compile the bundle by editing bundle.wixproj and changing your certificate for the one I'm using. It compiled successfully but the when I run the bundle installer. It crashes.

I put the log online, here: http://pastebin.com/ufLdMKSb

The topmost errors are w120: Detected partially cached package: Installer64, invalid payload: Installer64, reason: 0x80070570 w120: Detected partially cached package: Installer64, invalid payload: cabA7AE3FFD191951BE002C6D00822AFB39, reason: 0x80070570 Detected package: Installer32, state: Absent, cached: None Detected package: Installer64, state: Absent, cached: Partial

Could it be that I'm compiling a corrupt installer somehow?

riverar commented 7 years ago

Weird, what version of WiX are you using? I'm using 3.10.200.12920 and can confirm compilation works.

momashi commented 7 years ago

Oh, I was using was using 3.8. I'll give it a go with 3.10. I'll get back to you.

PS - I think you may need to update the build instruction on the main page, they still say Wix 3.8.

momashi commented 7 years ago

Hi Rafael, I went back to it and I tried with both Wix 3.10.2 and 3.10.0 and, though the wording of the Bundle's error logs were different from 3,8, the bundle was still crashing when it tried to launch the MSIs. So, I went to the compile log of the installers and noticed a very interesting warning:

C:\Users\Boo\Desktop\uxstyle-master\code\installer\Product.wxs(24,0): warning LGHT1056: T**he Directory table contains a row with primary key(s) 'System64Folder' which cannot be merged from the merge module 'msm\Microsoft_VC120_CRT_x64.msm'**.  This is likely due to collision of rows with the same primary key(s) (but other different values in other columns) between the database and the merge module.
Installer -> C:\Users\Boo\Desktop\uxstyle-master\bin\x64\release\Installer.msi 

So although it's compiling it without error, VS2013 seems to be miscompiling nontheless. This happens for both x86 and x64 and to take the Windows7 consideration out of the equation, I tried to compile it as a Windows 8 release (starting with a fresh project and source code folder each time).

Do you have any idea what's happening with the MSMs? How vital are they? Can I take out the MSMs from the installer script and simply install the corresponding VC redistributables myself?

I was meaning to ask you, do you still have the old source code that you wrote for windows 7? Maybe I might have an easier time compiling it. I still have the iso of VS2010 and Win7 DDK/SDK.

riverar commented 7 years ago

That's strange. You can definitely gut the MSMs (junk) and install the redist yourself.

momashi commented 7 years ago

I'll just do that. See how it goes.

I was just wondering what you meant when you said that you don't think this code base is compatible with 7? Were you talking about the VS2013+8,1 DDK and SDK or specifically about your source code?

momashi commented 7 years ago

I did more research on those error that from my compiled bundle and it seems you were right about the codebase not working for 7. The errors were platform related.

Do you by any chance still have the old source code for 7?

momashi commented 7 years ago

Don't worry about it, I just used the source code to reverse engineer the patch UXstyles applies in the RAM and applied it myself in a hex editor to the theme dlls. I'll keep UXstyles handy if I ever update to 8.x or heavens forbid 10.

I can make and put up a full guide on Test Signing to make compiling your project more accessible if you'd like.