Using signtool without Windows SDK? - windows-10

Can I use signtool on Windows 10 without the Windows SDK (2.5 GB) installed? Can I just copy the signtool.exe from a different machine?
I am building a cross platform application for Windows inside a VM which resides on my pretty small SSD, thus I don't want to blow it with unnecessary software.

OK, sometimes one should just give it a try instead of asking questions ;-) If anyone stumbles upon this:
Yes, one can just copy the small signtool.exe from a different machine (under Win 10 usually located at C:\Program Files (x86)\Windows Kits\10\bin\x64\) to your path (e.g. C:\Windows\).
No additional libraries are needed.

Related

NSIS faulty installation location

I am loosing my mind trying to get my way around why my setup behaves differently on the target device
Nsis version: 3.04
My machine: Win 10 64bit Build 17763
Client machine: Win 10 32bit Build 10586
We have no control the client machine because they are for schools and we have to make the app work exactly on them devices like on our laptops no matter what.
InstallDir "$LOCALAPPDATA\Programs\OurApp
on our machine this makes the setup install to
C:\users\username\local\appdata\programs\OurApp
but on the client machine it installs to
C:\Program Files (x86)\OurApp
I certainly can't understand why this keeps happening. The instructions to us that the data should not be accessible easily to the user except through the app we are building using .net. Then when the app is uninstalled it should clear the data it created. This only works when the app is installed in appdata location.
Any hints on why this is happening?
The initial investigation should be; is $Instdir set to the correct path inside the installer?
If you could write $Instdir to a log file on the client's machine that should help to narrow it down.
A common source of incorrect $Instdir is using InstallDirRegKey in combination with a existing older (possibly partial) install in a undesired directory.
If $Instdir is still c:\users... in your Section then you need to look at Windows, not NSIS. Tell them to look at the file properties of the installer .exe. Does it have any compatibility options applied? Do they have other compatibility shims applied through group policy?
It might also be helpful if they could run Process Monitor and send you a pml log file. That should reveal if a install dir is read from the registry and the actual paths passed to the kernel when it creates files and directories.
Finally, make sure you have RequestExecutionLevel user in your script to avoid UAC interference.

Running Platform Builder 5.0 on recent operating systems

Platform Builder 5.0 is only supported on Windows 2000 and XP.
This question is to aid those looking for a way to run Platform Builder 5.0 on more recent operating systems.
A few reasons one might want to do that:
Corporate IT policy may not permit the use of Windows 2000/XP
With time, genuine copies of Windows 2000/XP may become increasingly hard to obtain
Depending on your overall setup and requirements, might eliminate the need for using a virtual machine for Platform Builder 5.0
You may simply wish to run a more modern and secure operating system
This answer explains how to install and run Platform Builder 5.0 on operating systems it is not officially supported on.
Windows Server 2008 and 2012
This procedure has been found to work on:
Windows Server 2008 (32-bit)
Windows Server 2012
Windows Server 2012 R2
It is recommended that you install Platform Builder before joining a Windows domain. I've had some issues getting the Platform Manager components registered while logged in as a domain user. See also the description further below.
Virus protection software might prevent the installation of .NET Framework 1.1, at least this has been a problem with Symantec Endpoint Protection. You may have to remove any security products before starting the installation (these may be re-installed later, but see the note below on the Full vs. Basic version of Symantec EP).
To install PB5, start by copying the contents of the installation CD (or mounted .iso) to a local folder, from here onwards referred to as the installation folder.
Use an .msi editor (like Orca) to remove the following entries from Microsoft Windows CE 5.0.msi in the installation folder:
OS version check (Table LaunchCondition, Action (MsiNTProductType=1 OR ...)
Emulator device driver (Table InstallExecuteSequence, Action CA_InstallVMMDriver.3D2F911E_A60A_4C07_8F7D_5306DC073E9A)
From the installation folder, run, in this order
ISScript8.msi (installs the InstallShield 8.0 script engine)
dotnetfx.exe (installs .NET Framework 1.1)
Microsoft Windows CE 5.0.msi (installs Platform Builder 5.0)
The installation may appear to hang at the Registering Platform Manager components step. It should proceed after a few minutes. If it is still stuck after, say, ten minutes, and your machine is joined to a Windows domain, then kill the installer in Task Manager, leave the domain and try installing again (you can rejoin after the installation is complete).
During the installation, you will receive a warning about compatibility issues. Select Don't show this warning again and click Run the program without getting help.
After the installation has finished, add a registry entry as follows.
If installing on a 32-bit system:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools]
"SharedFilesDir"="C:\Program Files\Common Files\Microsoft Shared\"
Otherwise (installing on a 64-bit system):
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Shared Tools]
"SharedFilesDir"="C:\Program Files (x86)\Common Files\Microsoft Shared\"
Next, install Windows CE / Platform Builder updates as required (i.e. the "monthly updates" provided by Microsoft).
Optional: If any of your Windows CE targets require CJK support, you will need to update the cenlscmp tool to avoid an error during the makeimg phase. While this bug has long been fixed in Platform Builder 6.0 (PB6), the PB5 version has been left in the dust. So for CJK support you will need to copy cenlscmp from a PB6 installation, i.e. copy C:\WINCE600\PUBLIC\COMMON\OAK\BIN\I386\cenlscmp.exe to the corresponding folder in your new WINCE500 tree. Note that I've only tested the PB6 version; it is likely that newer versions would work too.
Optional: If you need support for building SDKs, you must make a copy of the Platform Builder help files, or a hard-coded assumption in the SDK builder will cause the build to fail. Copy the directory C:\Program Files (x86)\Windows CE Platform Builder\5.00\cepb\help to C:\Program Files\Windows CE Platform Builder\5.00\cepb\help.
Launch Platform Builder.
You will see a warning about compatibility issues. Select Don't show this warning again and click Run the program without getting help.
Optional: In the main window, click Tools | Customize. Click the Build OS menu once to open it. Drag the Build and Sysgen menu item out of the menu and drop it when the cursor displays a small 'X'. This will remove a dangerous command that, if clicked by accident, will require reinstalling Platform Builder. Hit Close to dismiss the Customize dialog box.
Platform Builder 5.0 is now ready to use, including the IDE itself, the build system, the help system, the debugger, and the run-time licensing tool.
Features that I haven't tested and which may or may not work include CETK and the emulator (the latter highly unlikely to work, as the emulator device driver had to be removed from the .msi).
If you use Symantec Endpoint Protection, be aware that the Full version may prevent pbxmlutils - an important Platform Builder tool - from running. This does not appear to be an issue with the Basic version.
One last hurdle is to configure the firewall to permit debugger traffic. To do this, open Windows Firewall with Advanced Security and
Under Inbound Rules, hit New Rule...
Select Program, Next
Enter the Path %ProgramFiles% (x86)\Windows CE Platform Builder\5.00\CORECON\BIN\cesvchost.exe, click Next
Ensure Allow the connection is selected, Next
Ensure Private and Domain are selected (but not Public, unless you really need this), Next
Enter a Name, e.g. "Platform Builder 5.0 debugger - cesvchost", Finish
Repeat the above with the path %ProgramFiles% (x86)\Common Files\Microsoft Shared\Windows CE Tools\Platman\bin\cemgr.exe.
Platform Builder will now be able to receive BOOTME frames, upload images, and connect to target with the kernel debugger.
Windows 7 and 8
The procedure documented above will not work for 64-bit Windows 7 or 8 (32-bit not tested).
Modifying the .msi as described makes the installation hang at the Registering Platform Manager components step. Removing the Platform Manager components from the installer causes a number of other issues, including failed registrations of the Help system and some common controls. More importantly, with Platform Manager missing it will not be possible to install any Windows CE/Platform Builder updates, making it virtually impossible to build any non-trivial CE project.
Windows 10
Not tested.

Conversion to x64 platform in visual studio failing

So I built a huge website for my company using the AnyCpu option. I didn't think it would matter - I have a 64bit machine with x64 windows, it's getting deployed to a x64 server, and there's no attached dll's, so it should just all be in 64, right?
Well, in the process of trying to implement some security, the company's support told us the application MUST be strictly x64. I figured it was, but to humor them, I went into the configuration manager, and changed all the target cpu, platform etc settings to x64.
Unfortunately now, it breaks when I hit f5 to run it. I've run into this before, I think, and I vaguely remember needing to delete some temp internet files somewhere, but I tried closing VS, deleting the bin folder, deleting the root folder from /framework/tempASPfiles... but I still get the BadImageFormatException - "an attempt was made to load the program with an incorrect format."
What's the best and fastest way to convert an app to x64? and am I right in thinking I need to delete some files somewhere?

Converting Windows App written on XP to Windows 7

I inherited a huge code base which was written to work on Windows XP. Now we would like to migrate to Windows 7. I do not know what is the proper way to go about this. What is the proper approach to do the above task? I did some googling on differences between XP and Windows 7 but I do not get any proper links which describe how the internals of 7 differ from XP. Any links will be appreciated.
Usually how do S/W developers migrate their code/apps written for one version of OS say Vista to Windows 7?
I sell an autoupdate solution (AutoUpdate+, minor plug) and so have lots of experience porting Windows apps to the latest releases, and yet still maintaining backwards compatibility. Porting from Windows XP to Windows 7 can be a big challenge (there should be almost no difference in a move from Windows Vista to Window 7).
Window XP doesn't care where your application exists, and hence programmers would dump both their application and support logic (log files, config files, user profiles etc.) into the same location under "C:\Program Files\". Take this application to Windows 7 and you'll start finding some unusual behaviors. For starters, you will notice that files seem to 'disappear'. Instead of a log file being modified under the common Program Files location, you may end up with multiple, and separate, copies for each user under "Compatibility / Program Files". Windows Vista/7 introduced file system virtualization, and will now create separate user instances of files to ensure to ensure that each user has their own secure copy.
Another problem you will encounter on Windows Vista, and to a lesser extent on Windows 7, is User Account Control (UAC) prompts. It's similar to the issue above, in that new security restrictions will now cause Windows Vista/7 to prompt the user for approval to proceed. The most noticeable area where this occurs is when you are tampering with executable files in sensitive directories, installing applications and drivers, and sometimes when trying to self-update an app (the abovementioned app actually works around these prompts with some smart logic).
So in short, security changes are the biggest difference between Windows XP and Windows Vista/7. Your best start is to separate application logic (binaries) from supporting logic, by putting the latter into user specific directories. Some apps may never be fixable and can be forced instead to work in Compatibility Mode or to launch always under the Admin account context --- poor workarounds, but may be suitable in your company.
Simon # http://AutoUpdatePlus.com
There are three parts to the migration. First, make it just plain work. This means fixing up hardcoded file paths (there's no more Documents and Settings), changing some of your save locations so you don't need to be elevated to work properly and don't rely on virtualization, changing some of your registry key locations for the same reason, and coping with high-DPI which might now be applied automatically based on screen size rather than as a user's choice.
Second, make it look and work like a Windows 7 application. Is your jumplist usable? Your thumbnail? You get some things for free, do you like what you get or would you like to take control? Are there obvious wins you could use like thumbnail buttons, jumplist tasks, taskbar overlays, etc. Don't surprise your users and don't disappoint your users. (Example of disappointment: VS 2008 and the crummy jumplists it offered. They had the excuse of being released before Windows 7 - you don't.)
Third, take advantage of Windows 7 to be greater than you otherwise would. Stop polling for network joins, file creation, hardware being plugged in, going on and off AC power etc and learn how to get notified when those things happen. Add touch support beyond what you get for free. Talk to a sensor or GPS for the first time, since Windows 7 makes it simpler than it ever was. That sort of thing.
1 is not optional. 2 is really not optional either, a year after Windows 7 is released. 3 will differentiate you and I recommend, once you get past 1 and 2, you look into it.
Basically Windows7 is a 4bit OS and so necessarily runs on a 64bit processor environment. XP has 32bit as well as 4 bit flavours. If your application is for the 32bit version of XP, in that case, the major migration means making the application run on 4bit OS effectively.
The basic steps can be something like this:
Make it compatible to 64bit win7. So you may just compile the code off a win7 machine (on 64bit). If the compilation works fine, you might be able to run the app successfully.
The first step just allows to move ahead. But your application might not be effective. In that case, you might have to review the code for any specific implementation coupled on 32bit os and upgrade them to take advantage of 64bit OS.
The major advantages on 64bit OS is higher address-ability (so access more RAM) and also cache etc.
I did some googling on differences between XP and Windows 7 but I do not get any proper links which describe how the internals of 7 differ from XP. Any links will be appreciated.
API diff report between XP and Vista: https://abi-laboratory.pro/compatibility/Windows_5.0_to_Windows_6.0/x86_64/abi_compat_report.html
API diff report between Vista and 7: https://abi-laboratory.pro/compatibility/Windows_6.0_to_Windows_7.0/x86_64/abi_compat_report.html
The reports are generated by the abi-compliance-checker tool.

How to run MSVC++ 6.0 off a USB drive as a portable app

Without using any third party program to do this (i.e. without VMware ThinApp, U3 or MojoPac etc.) How to move MSVC++ 6.0 from from its install on C: over to a USB drive? So that it can be used on different PCs with no admin rights and without installing anything on the host PC? Even if it's only usable as a console application would be fine, although to have the GUI including Visual Assist etc. would be even better.
Move the two folders that install created under c:\program files\ to the USB drive (e.g. to e:\progs\msvc\msvc6 and e:\progs\msvc\vc98), and append to the file e:\progs\msvc\vc98\bin\vcvars32.bat to suit e.g.
prompt $g
set path=e:\progs\uedit;e:\progs\utl;%PATH%
e:
cd e:\work
start e:\progs\uedit\uedit32.exe /i=e:\progs\uedit\uedit32.ini
cmd /k
Using a shortcut to vcvars32.bat then works fine for doing any simple console programming, which is all I’m using it for so far. I don’t know how well any of the GUI type programs in the tools folder will function.
I am not sure exactly how one would do that.
Here are a few ideas.
The installation procedure creates at least two sets of directories, so you could direct both of them onto the usb drive.
The installation procedure creates a bat file, that sets up the environment variables correctly for command line execution. Modifying it to point to the correct drive letter when your memory stick loads on the other machine may be important.
There are also registry entries for vc 6. Extracting them, and having a script of some sort to load them onto your target machine when needed, might be useful.
Is there a specific reason why vc 6 is required? Would another compiler do?
I haven't done this, but it should "just" be a matter of:
Copying all the application files to a USB drive. Remember there will be shared files and stuff that may need to go into the Windows directory.
Identifying and copying all of the registry entries, although you may need to be admin to create some of these on the target machine.
That's a heck of a lot of work, for little gain in my opinion. I think there may be a command line only version of the Visual C++ tool chain that may better suit your requirements. IIRC it was released to help people create build bots for open source projects, like the Mozilla Tinderbox, and includes the VC++ 7.0 compiler.

Resources