Code Signing Certificate Flag - code-signing

Is this MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG flag used for code signing supported on Windows XP, Windows Vista and Windows 7?
When I am using this flag in CertVerifyCertificateChainPolicy function on above operating systems, I am getting
CERT_E_UNTRUSTEDROOT
error.
It is working fine for me on Windows 8 and above though.

According to Microsoft
The dwFlags member of the CERT_CHAIN_POLICY_PARA structure pointed to by the pPolicyStatus parameter can contain the MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG flag, which causes this function to also check for the Microsoft application root "Microsoft Root Certificate Authority 2011".
So make sure those older systems have "Microsoft Root Certificate Authority 2011" package installed. For more info, see http://support.microsoft.com/kb/931125
To Manually install the certificates
Download http://download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/rootsupd.exe
Extract the files using the command rootsupd.exe /c /t:C:\temp\extroot
from c:\temp\extroot run the following 4 commands (from an elevated prompt)
updroots.exe authroots.sst
updroots.exe updroots.sst
updroots.exe -l roots.sst
updroots.exe -d delroots.sst

Related

Run appx file in current Windows 10 device using the PowerShell cmdlets

I have an appx file which was generated elsewhere and I would like to test it in my Windows 10 machine.
The appx file is already available to me and I can deploy it to other devices using the WinAppDeployCmd, which works for the XBox One. This works perfectly with the following command:
WinAppDeployCmd install -file "!MY_FILE!" -ip "!DEVICE_IP!" -pin "!DEVICE_PIN!"
My question is, is there a similar command to simply run my .appx in the windows machine where it currently is? Is there perhaps even a way to use the WinAppDeployCmd to install it in the current machine?
I don't know about cmd, but in PowerShell you can use
Add-AppxPackage -Path C:\Users\User\MyApp.appx
If the package is unsigned, you will need to enable developer mode in Windows 10 before it can be installed.
Open Settings.
Click on Update & security
Click on For developers.
Under “Use developer features”, enable Developer mode.
More information on Add-AppxPackage: https://technet.microsoft.com/en-us/library/hh856048.aspx
Update: Regarding using WinAppDeployCmd for this see: Can I Use WinAppDeployCmd install, update on pc itself

Compiled Visual Basic Application gets Runtime Error 52 in Windows 8

The application that I compiled via Visual Basic 6 can run on my Windows XP computer. But when I execute the same executable on my other computer that runs Windows 8, I always get Runtime Error 52-Bad File name or number as soon as I launch it. I can't run the program even if there is no "Shell command" in that program which leads to a "Bad file name" error.
I used "Package and Deployment wizard" for the packaging process.
And also I registered the needed DLL's on the Windows 8 PC manually via the regsvr32 command line utility.
I also cleaned the whole registry via a registry cleaner (Wise Registry Cleaner). I used compatibility mode for Windows XP but nothing solved the problem.
Additional informations:
XP Version - SP 2
Windows 8 Version-8.1
VB - VB 6.0
Assuming that your code is
If Dir("C:/file.txt") = "" Then...
Change it to a backslash ("\")
After some research I found the answer for the problem. That was not a problem in the coding; it was ALL about windows 8 compatibility.
Go to the “Compatibility” tab of the properties window of the file and select “Windows XP SP2” under the “Compatibility mode”. That’s all
Windows 8 no longer allows you to write programmatically in the root of drive C:\ (and in many others 'system' folders like Program Files, Windows, System32, ...).
Try to use a sub-folder.

When creating a Blackberry Developer Certificate blackberry-keytool command not found is coming up in terminal

May be an obvious error, but I am running the below & getting the error
-bash: blackberry-keytool: command not found
I am running this in terminal and cd to the correct folder. Any advice would be perfect!
blackberry-keytool -genkeypair -storepass password -dname 'cn=<company_name>'</company_name>
i am using the guidance over in the below and posted this there by have had no answer.
https://developer.blackberry.com/html5/documentation/beta/testing_and_signing_setup.html#kba1383328834110
Thank you in advance.
Any advice would be great!
Programs likes blackberry-keytool are all in the BB10 NDK directory. The first thing you should do to prepare for bash scripting is to run the development environment script inside where you installed the NDK. I'm on Mac OSX so I would execute:
/Applications/Momentics.app/bbndk-env_10_2_0_1155.sh
If that still doesn't work, you can find the program in your /Applications/Momentics.app/host_10_2_0_15/darwin/x86/usr/bin directory.
Copy your BlackBerry ID token (bbidtoken.csk) to the following directory:
Windows XP: %HOMEPATH%\Local Settings\Application Data\Research In Motion
Windows Vista, Windows 7, and Windows 8: %HOMEPATH%\AppData\Local\Research In Motion
Mac OS: ~/Library/Research In Motion
Ubuntu: ~/.rim
From the command line, navigate to the cordova-blackberry/bin/dependencies/bb-tools/bin subfolder of your BlackBerry 10 WebWorks SDK installation folder.
Run the blackberry-keytool command to create your developer certificate (author.p12 file).
blackberry-keytool -genkeypair -storepass -dname "cn="
When you run this command, the author.p12 file is created in the same folder where you installed the bbidtoken.csk in Step 1.

Signed ghostscript postscript print driver

I am using the Windows postscript print driver that is shipped with ghostscript (lib/ghostpdf.inf) to generate postscript files from print jobs.
However the postscript driver is not digitally signed, so Windows 8 and Windows Server 2012 won't allow installing it without booting into the "allow unsigned drivers"-mode.
Do you know if there is any signed version out there to be used with the latest Windows versions?
If thats not the case, I am fine compiling and signing it myself, however I was not able to find the source code for the postscript print driver within the git repo available at http://git.ghostscript.com/ghostpdl.git.
May I've just overseen it since I am not familiar with building drivers.
Can one give me a hint where I can find the postscript driver files to compile it myself?
EDIT: How does the .INF file tell windows where the driver binaries are located? I've looked into the "ClassGUID" however its the same for all drivers and the registry entry says something about C:\Windows\System32\ntprint.dll. I don't think this is important for the problem, is it?
To sign "the ghostscript driver" you just have to sign the INF-file that comes with Ghostscript.
There's an article on technet describing the steps required to do so.
The steps are:
1) Create/acquire a certificate
2) Ensure that your computer trusts the certificate (place it in your cert store if required)
3) Download and install the Windows Driver Kit (WDK)
4) Change the CatalogFile=oemprint.cat in the INF file to ghostpdf.cat
5) Change the DriverVer=01/02/2007,1.0.0.1 to DriverVer=01/01/2013,1.0.0.1 (maybe you need some other date, you'll see that in the next step)
6) Use the Inf2Cat tool to create a cat file (was at C:\Program Files (x86)\Windows Kits\8.0\bin\x86 for me):
NOTE
Use cmd.exe not powershell, as powershell gives Parameter format not correct. error all the time
Command:
inf2cat.exe /driver:c:\path\to\folder\whereCatFileIsIn /os:7_X86,7_X64,8_X86,8_X64[,other OS you'd like to support]
7) Sign the cat file using the signtool (Same directory as the Inf2Cat tool)
Command:
SignTool.exe sign /f "C:Path\to\my.pfx" /t http://timestamp.verisign.com/scripts/timestamp.dll "C:\Path\To\ghostpdf.cat"
(See the signtool docs for more informations about the available paramters)
.inf files are not drivers, they are just text files with some installer information. There is no signed version of this, nor do you need it, you can use the output of any PostScript driver with Ghostscript.
You can't compile a .inf file, because there is nothing to compile, I have no idea how you go about signing such a thing in the latest versions of Windows, but if you want to give it a try you can open the .inf file with a text editor.
Q: Do you know if there is any signed version out there to be used with the latest Windows versions?
* Workaround *
A: For my Postscript driver issue I re-used the already signed driver from freeware PDF generator PDFil Writer.
https://www.pdfill.com/freewriter.html
In my case, I am a Sybase Powerbuilder developer, and my application depends on the Ghostscript Postscript driver.
I hope this helps.

program to install firefox exetension in windows?

Is it possible to build a installer(or program) in windows 7, that can install extension to firefox (if the browser installed on the machine).
or atleast help me by providing command to install firefox extension through command line in windows7.
("firefox addon.xpi" command is available in linux)
Thanks
Installation of extension in Firefox is very simple.
You need to launch Firefox.exe with your .xpi file as parameter
The official documentation says you should use -install-global-extension switch (not sure why, it should worked also without it, at least in older versions it did).
firefox.exe -install-global-extension "<path>\extension-file.xpi"
Details here: http://kb.mozillazine.org/Command_line_arguments
If you want to create whole installer with this feature, let's say in NSIS:
Function InstallFirefoxExt
InitPluginsDir
SetOutpath "$PLUGINSDIR\"
File "extension-file.xpi" # Extract file to temporary directory
Exec '"<path>\firefox.exe" -install-global-extension "$PLUGINSDIR\\extension-file.xpi"'
FunctionEnd
If you use other installation system it is very similar.
To install a Firefox extension on Windows you should simply add a value to the Windows registry. This can be done by opening a .reg file or running reg.exe with the right parameters, a custom Windows application to add it would also be trivial. Adding to HKEY_CURRENT_USER can be done without advanced privileges (no UAC prompt), adding to HKEY_LOCAL_MACHINE (for all users) requires administrator privileges.
I would advise against using -install-global-extension since that adds the extension to the Firefox application directory - you have to know where Firefox is installed, administrator privileges are always required and updating/uninstalling the extension is non-trivial. Also, firefox addon.xpi will install into the default user profile - in addition to the disadvantages of -install-global-extension this doesn't consider the fact that more user profiles could exist on the computer (or be created in future).
Firefox path can be detected by reading this registry key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\20.0.1 (en-US)\Main" "PathToExe"
On my PC this PathToExe looks like "C:\Program Files\Mozilla Firefox\firefox.exe" so this is exactly the value you need.
However this is a little tricky because the key contains Firefox version 20.0.1 (en-US)
To get this version at first read this key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox" "CurrentVersion"
which will return 20.0.1 (en-US)
Simply join all parts together:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\" + <CurrentVersion> + "\Main"
to get whole key.

Resources