Licence Protector

Windows Vista / Win 7 / Win 8 Guide

Hide Navigation Pane

Windows Vista / Win 7 / Win 8 Guide

Previous topic Next topic No directory for this topic  

Windows Vista / Win 7 / Win 8 Guide

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for the print function Mail us feedback on this topic!  

As a licensing and copy protection system hooks deeply into the Windows operating system, it often requires modifications.

 

Licence Protector is fully Windows Vista compatible:

 

Considers registry limitations

Runs with limited user rights

Offers a signed DLL

 

To use your application with Licence Protector and Windows Vista only a few modifications are necessary:

 

Install Licence Protector version 3.1 or higher

Use the signed EasyGo.DLL

Install the license file to C:\ProgramData\yourcompany name\appname\app.lic - see details

 How to retrieve the correct folder name

Considerations

The installation has to be done in administrator mode. A user with a standard account will automatically be prompted to provide administrator credentials.

 

If User Account Control is enabled (default) the following installation scenario is NOT working.

 

install the licence file to C:\Program Files\YourApp\app.lic

 

If the standard user starts your application, Licence Protector will write back information in the licence file (depending on the features your are using). The file would be virtualized to the folder C:\Users\username\AppData\Local\VirtualStore\Program Files\YourApp\app.lic.

 

Although your application would open the licence file on C:\Program Files\YourApp\app.lic, the file would be opened in c:\Users\username\AppData\Local\VirtualStore\Program Files\YourApp\app.lic. The result would be that each user has a different licence file.

Recommendation

Although we found no recommended procedure from Microsoft how to share a file on one PC for all users, the following installation process will work.

 

Install the licence file to C:\ProgramData\yourcompany name\appname\app.lic

 

By default, standard users have only Read access and the folder is not visible. See below how to set write access to this folder.

Retrieve folder names

You can retrieve the folder name via the registry.

 

 

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Shell Folders

Common AppData

C:\ProgramData\

Common Programs

C:\ProgramData\Microsoft\Windows\Start Menu\Programs

Common Documents

C:\Users\Public\Documents

Common Desktop

C:\Users\Public\Desktop

Common Start Menu

C:\ProgramData\Microsoft\Windows\Start Menu

CommonPictures

C:\Users\Public\Pictures

CommonMusic

C:\Users\Public\Music

CommonVideo

C:\Users\Public\Videos

Common Favorites

none

Common Startup

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Common Templates

C:\ProgramData\Microsoft\Windows\Templates

Common Administrative Tools

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools

Personal

none

Set write access for the group 'users' to this folder - see details

 

Some installers have built in options to change rights on folders. You cannot use the standard Windows tool cacls.exe or icacls (Vista) because you have to address the user / group name you want to change in the language of the operation system - e.g. 'users' or 'Benutzer'.

 

There is a tool SetAcl.exe which allows using SID to change the permission. The tool can be downloaded here: http://setacl.sourceforge.net/html/examples.html . Documentation for the SID can be found here (only German): http://www.grurili.de/index.html?/Grundlagen/WellKnown_SIDs.htm

 

Your installer could use the following sequence

 

Copy setacl.exe to the installation directory

Execute Setacl.exe e.g. "maindir\SetAcl.exe" -on "maindir" -ot file -actn ace -ace "n:S-1-5-32-545;p:full;s:y" - This will set full rights to the group users. The SID S-1-5-32-545 is used instead of the name users
 
(note: maindir is the folder name like c:\ProgramData\yourcompany name\appname)

Delete setacl.exe

 

 

Problems to register a DLL in Vista / Windows 7

         Check comments how to register a DLL and which problems may occur

Installation of the DLL

 

The folder ..\files for distribution contains all Licence Protector DLLs. There is an folder with a compressed version and uncompressed version. We recommend using the uncompressed version because it works with all compilers and operating systems.

 

Licence Protector offers different ways to register the DLL / COM exe:

 

Using LPRegister313.exe - it registers the DLL / COM exe without needing administrator rights

Do not register the DLL if you use a manifest file. Administrator rights are not needed. Manifest files are not supported for the COM exe

Register the DLL / COM exe with the windows tool regsvr32.exe or the inbuilt option of an installer. This requires administrator rights

 

 

You should copy the licprotector313.dll to the \windows\system32 folder although it could also be installed in your program directory. As each DLL version of Licence Protector has an own ProgID, multiple different versions can be installed on the same machine.

 

Best Practice

If your installer needs administrator rights, use the inbuilt option of the installer or regsvr32.exe. To use regsvr32.exe add a shell execute command in the installer which invokes regsvr32.exe
- Register the DLL:  Execute "c:\windows\system32\regsvr32.exe"  " ....\pathname\LicProtector313.dll" (note: this requires administrator rights)
- Register the COM exe: LicProtector313.exe /regserver   (note: this does not require administrator rights)
 

If your installer does not need administrator rights then use LPRegister313.exe

If you do not have an installer and you only copy files to a folder, use a manifest file

If you just want to register the DLL manually on one system, use LPRegister313.exe. Using regsvr32.exe would work as follows:
 

- right click on “Command Prompt” in Accessories and click “Run as Administrator

- run regsvr32 "....\pathname\LicProtector313.dll” in the command window

 

 

If multiple users on one computer or services use the COM exe, then you have to register it using administration rights and the command: LicProtector313.exe /regserver /NOREDIRECT

 

Vista / Windows 7 and MSI files
Some installers generate a message HRESULT -2147220472 or -2147023898. This is due to missing rights during installation. Use LPRegister313.exe to register the DLL and not the installer built in dll register function.

 

 

 

Sign your installer file to avoid error messages after download or after starting the installer  see details
How to sign installation file

Sign your Installer file

Although you could deliver an unsigned installer file, we recommend adding your digital signature. You can buy a code-signing certificate from one of the accredited providers like www.verisign.com, www.thawte or www.comodo.com.

 

With the digital signed installer file your users do not get warning messages when they download the file or start the file.

 

First check your installation tool if it supports to add a digital signature. As installers often add their own CRC checks a digital signature would destroy the installer file. Therefore the installer tool has to add the signature first before the CRC check is added.

 

Visual Studio 2005, 2008 - special considerations

 

In Visual Studio 2008 or Visual Studio 2005 with .NET Framework 2.0 SP1, generated EXE files have a Data Execution Prevention flag set. To get your application running under Windows Vista / Windows 7, you need to remove this flag.

 

If you get an error message with the 800703e6 then the cause is the DEP flag.

 

You can use the following batch script to remove it (for VS 2008):

 

 

call "%VS90COMNTOOLS%vsvars32.bat"
editbin.exe /NXCOMPAT:NO YourApplication
pause

 

If the environment variable %VS90COMNTOOLS% is not set or points to the wrong directory, then search for the vsvars32.bat. The bat file is for the default installation in the folder c:\programs\microsoft visual studio9.0common7\tools

 

You could also use a post-built event using this command line:

 

call "$(DevEnvDir)..\tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(TargetPath)"

 

Click to enlarge
Compiler settings for DEP Flag

 

For further information have a look at the following page:
http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx

 

 

 

 

Starting with Service Pack 2.6.4 the compile switch is no longer required, if you use the uncompressed DLL version in the folder Licence Protector\3.1\files for distribution\signed-uncompressed.

 

Visual Studio allows an installation without registering the DLL. See details - use DLL without registering the DLL.

 

Compiling with .NET 4 will result in an error.  Compile using the COM exe

 

See also 64bit operating systems.

 

 

 

Code Protection with All-In-One Protector

To protect the code against de-compilation or reverse engineering, you can combine Licence Protector with All-In-One Protector for a special bundle price.

 

See chapter: Code Protection / Decompile Protection

 

 

 

 

Vista / Windows 7 / Windows 8 64bit

Licence Protector is a 32bit DLL. It runs on 64bit operating systems like Vista / Windows 7 64bit or Windows 2008 Server 64bit as long as the main application is compiled for 32bit.

 

If you need a 64bit compile or you compile a .NET application for any CPU or for .NET4, you have to use the COM exe version of Licence Protector - LicProtector313.EXE. It is a DCOM component which can be used by  a wide range of compilers. It can be found in the folder The folder Licence Protector\3.1\files for distribution\COM exe

 

The COM EXE supports 32bit and 64bit operating systems as well as 32bit and 64bit compiles.

 

There is no need to change the source code (only to change the ProgID) to switch from a 32bit compile to a 64bit compile. Even applications, compiled with 32bit and 64bit within a network can access the same license file.

 

 

Depending on the development tool you add the COM exe (like a DLL) with a command like

 

Private objlic As Object

Set objlic = CreateObject("LicProtector.LicProtectorEXE313")

 

 

The LicProtector313.exe in version 3.1.3 has the ProgID " LicProtector.LicProtectorEXE313" This allows using an older LicProtector.exe in combination with older versions of LicProtector.exe on the same system. The ProgID changes with every main release. The file name of the exe is different from the ProgID (file name: LicProtector313.exe - ProgID: LicProtectorEXE313).

 

 

 

As the COM exe works with 32bit AND 64bit compiles, you can exclusively use the LicProtector313.EXE instead of the DLL.

 

To use the COM exe (64bit) for testing with the License Tester, select EXE right to the Licence Protector version number.

 

 

 

Registration

The COM exe has to be registered with LicProtector313.EXE /regserver. If the user does not have admin credentials, it will register for this user only. There are some situations where you need to register on machine level (e.g. your application is a service). Then use LicProtector313.EXE /regserver /NOREDIRECT. This requires administrator rights

Alternatively you can use the Licence Protector registration tool to register without admin rights

 

Permissions

Some applications may require special permissions for the COM exe (e.g. if they are a service). You can change the permission:

 

From the Start menu, click Run and type Dcomcnfg.exe

In Component Services, click Console root, expand Component Services, expand Computers, and then click My Computer

Expand DCOM Config and search for LicProtector Obj

Right click - select properties and then the Security TAB

 

 

 

 

Errors

A compile setting for any CPU will generate an error 80040154 at runtime. Either use the COM exe (recommended) or change your compile settings to compile for compiled for x86 CPU.

Find below how to change the settings for Visual Basic 2008. Other .NET compilers have a similar option.

 

To change the platform open the project properties and click under the submenu "Compile" on the button "Advanced Compile Options...": 

 

Click to enlarge
Advanced Compile Options

 

 

Now you can change Target CPU from "Any CPU" to "x86".

 

 

 

 

 

 

 

 

 

 

Filenames in Vista / Windows 7 / Windows 8

 

A file name, which has words  like setup or install in the name, would have as a result, that the file needs administration rights. In Vista / Windows 7, the UAC (user account control) would pop-up. For more details about EXE names and Vista read this blog.