HeuerJan
Posts: 9
Joined: Thu Jul 31, 2008 8:13 pm

Problem with TRIAL option at enterprise version

Hello,

I have a big problem using the TRIAL option of the Licensing Tool:

I am using VB and integrated the example lines from the Advaced Installer help exactly as shown. But If i build this example in VB 2008 I get the following error message, even if I load and build the examle from the AI Help!

Error The command "call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "C:\TrialVB\bin\Release\test.exe"" exited with code 9009. test

What is wrong?

This is the error at the original VB Example file from the Advanced Installer help:

Error The command "call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "C:\Trial Test Example\TrialTestExample.NET\TrialVB\bin\Release\TrialVB.exe"" exited with code 9009.
TrialVB

This is my VB code:

Code: Select all

Imports System.Runtime.InteropServices

Public Class Form1

  ' This function does all the work
  <DllImport("Trial.dll", EntryPoint:="ReadSettingsStr", CharSet:=CharSet.Ansi)> _
  Private Shared Function InitTrial(ByVal aKeyCode As String, ByVal aHWnd As IntPtr) As UInteger
  End Function


  ' Use this function to register the application when the application is running
  <DllImport("Trial.dll", EntryPoint:="DisplayRegistrationStr", CharSet:=CharSet.Ansi)> _
  Private Shared Function DisplayRegistration(ByVal aKeyCode As String, ByVal aHWnd As IntPtr) As UInteger
  End Function


  ' The kLibraryKey is meant to prevent unauthorized use of the library.
  ' Do not share this key. Replace this key with your own from Advanced Installer 
  ' project > Licensing > Registration > Library Key
    Private Shared kLibraryKey As String = "8DC6A1A385468B3D13EDB3B1AA359184F8DC6A1A385468B3D13EDB3B1AA359184F"

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Try
      Dim Proc As Process = Process.GetCurrentProcess()
      InitTrial(kLibraryKey, Proc.MainWindowHandle)
    Catch ex As DllNotFoundException
      MessageBox.Show(ex.ToString())
      Process.GetCurrentProcess().Kill()
    End Try

  End Sub

  Private Sub RegisterBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RegisterBtn.Click

    Try
      Dim Proc As Process = Process.GetCurrentProcess()
      DisplayRegistration(kLibraryKey, Proc.MainWindowHandle)
    Catch ex As DllNotFoundException
      MessageBox.Show(ex.ToString())
      Close()
    End Try
  End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        Close()

    End Sub
End Class
And I added the post build lines :


call "$(DevEnvDir)..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(C:\Trial Test Example\TrialTestExample.NET\TrialVB\bin\Release\TrialVB.exe)"

The following generated the same error:

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

What is the right syntax. I think the problem is right there ...


Please help me!!!
Last edited by HeuerJan on Wed Feb 25, 2009 8:15 am, edited 1 time in total.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with TRIAL option at enterprise version

Hi,

The post-build events seem to be correct. Please try removing them from the project and run the command from "cmd.exe" (you first need to find "editbin.exe"):

Code: Select all

editbin.exe /NXCOMPAT:NO "$(C:\Trial Test Example\TrialTestExample.NET\TrialVB\bin\Release\TrialVB.exe)"
If the behavior is the same, perhaps the problem is caused by the machine. In this case please try building the project on another machine.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HeuerJan
Posts: 9
Joined: Thu Jul 31, 2008 8:13 pm

Re: Problem with TRIAL option at enterprise version

Hello,

it looks like the VS 2008 Installation is the problem . Initially I did not found the editbin.exe file. Now I Installed the further dev tools ! Now the editbin call generates a warning with msqdb80.dll is missing ...
I am just deinstalling all of my dev components and then I will install it again on a clean image of this machine!

Hope this is the solution!

Thanks !
HeuerJan
Posts: 9
Joined: Thu Jul 31, 2008 8:13 pm

Re: Problem with TRIAL option at enterprise version

Solution:

Instead of vsvars32.bat I used vcvars32.bat and everything worked fine!
HeuerJan
Posts: 9
Joined: Thu Jul 31, 2008 8:13 pm

Re: Problem with TRIAL option at enterprise version

WAHHHHHHHHHH Now I have a different problem:

At my vista machine everything works fine now,

BUT If I am installing the application at a XP machine ( Win XP Sp3 DotNet 3.5) it crashes with the message:

"attempted to write or read protected memory ..."

It looks again like a "Data Execution Prevention" error.

Is there another flag I need to add to the post build script to make this trial option running at a Win XP machine ???
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem with TRIAL option at enterprise version

Hi,

I'm not sure why you are encountering this behavior. If it works on Vista it should also work on XP. Can you please test the package on other machines?
In the next version of Advanced Installer we will improve this part of the trial to remove the DEP flag automatically. The next version is scheduled for release in the near future.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HeuerJan
Posts: 9
Joined: Thu Jul 31, 2008 8:13 pm

Re: Problem with TRIAL option at enterprise version

Thank you cosim for that good news.

I tested it already on different machines. VISTA and XP. As far as I found in different internet forums there are not to much solutions.

I appreciate, that you improve this function, which is very helpful especially for smaller offline working software packages.

Generally this function is very useful and a very good idea for integration in Advanced Installer!

Regards

Jan Heuer

Return to “Common Problems”