Don't include USER32.DLL in built applicatio​n

Hello,
I would like to avoid including USER32.DLL in the installer for my built application. I am using several Windows API functions from USER32.DLL, and as soon as I select the top-level VI, an entry for USER32.DLL shows up if I click the "Files" button on the "Installer Settings" tab. I want to just use the local version of the DLL once it's installed.
I'm using another windows DLL, and it somehow isn't getting included - I think because in the "Call Library Function" configuration dialog there is no path, just the file name. If I try to delete the path from my calls to USER32.DLL (i.e. delete "C:\WINNT\System32\"), it automatically re-appears once I close and reopen the dialog box. I've also tried using just "USER32.*", but the path still gets added automatically.
Any ideas?
TIA,
Jaegen

Waldemar,
Thank you very much for your insight.
This is a very interesting/intriguing problem ... Please bear with me as I try to describe it:
It seems that LV is treating DLLs exactly as it would a sub-VI. Once one VI which uses a DLL is loaded into memory, all other VIs which use a DLL with the same name, regardless of the path used, use the same DLL. I was trying to delete the path in one VI, while other VIs with the path were in memory. Therefore, as soon as I clicked OK, LV just went ahead and added the path again. However, if I loaded the VIs separately, I was able to delete the path. I was tipped off when I did this with only one sub-VI, then loaded the top-level VI and was presented with the warning that "USER32.DLL" was actually found at "C:\WINNT\system32\USER32.DLL" for the VI I had changed.
Now of course the problem arose as to how I delete the path for a DLL call when the VI has two separate calls to the same DLL (i.e. if I delete the path for one, while the other still has the path, it won't be deleted). I had to mangle the name in one call ("C:\WINNT\system32\xUSER32.DLL"), delete the path in the other ("USER32.DLL"), then delete the path in the first. Likewise, when one VI with a call to the DLL uses a sub-VI which also calls the DLL, I had to go through this process with all the calls in all the VIs.
I hope I'm making sense. I was able to eventually get the paths permanently deleted from every call, and "USER32.DLL" no longer appears when I go to build an executable.
I'm not sure if this is a bug per se. I'm not sure what else LV could do, other than display a warning dialog when you click OK on the DLL config dialog. However, it would be nice if the application builder allowed DLLs to not be included (even if it thinks they need to be).
By the way, I did work out a very interesting work-around for this before realizing the details I described above: I included a batch file in the installer, which I called using the "Run executable after installation" option, which cd'ed to the install path, deleted USER32.DLL, then deleted itself (I didn't know this was possible until now).
I did however discover a bug in the application builder help documentation:
On the page titled "Advanced Installer Settings Dialog Box (Windows, Professional System Only)", the "- Executable" paragraph states "The file must be one of the files that you install in the Installer directory you selected in the Installer Settings tab." This is not the case. It should read:
"The file must be one of the files copied to the *Install Directory* using the "Installation Destination Settings" dialog. (Click the "Files..." button on the "Installer Settings" tab)."
Note "Install Directory", not "Installer directory".
Hopefully this all makes sense and is informative.
Cheers,
Jaegen

Similar Messages

  • Windows API dll (user32.dll) cause fatal error

    Hi,
    On a setup, we using a touch screen. The LabView Software is running on full screen. I need to deactivage my front panel if the screensaver is on to prevent user start anyting. I use SystemParametersInfoA from user32.dll and this is working good, except, if I quit the software. "myexe a fin a error and need to close" (someting like that, my XP is in french).
    I don't have issues in debug mode, this error happen in exe mode.
    I use LV 8.6.1. Do you have any idea why?
    Thank you
    Solved!
    Go to Solution.
    Attachments:
    test.zip ‏10 KB

    CFiset wrote:
    Thank, I will take care of this details. But, unfortunly, this not working.
    uint32_t SystemParametersInfoA(uint32_t SPI, uint32_t 0, uint32_t *value, uint32_t False);
    SPI = 114 = SPI_GETSCREENSAVERRUNNING
    If *value != 0, screensaver ON, else scresaver OFF
    Still have the fatal Windows error.
    Thank
    I noticed the Call Library Node having a rather strange path to user32.dll on the initial load. Do you happen to have copied that DLL somewhere and referencing it with full path in your VI?
    That is a very big NO-NO! user32.dll and many other Windows system DLLs do weird things to the system and are utterly bad behavioured if you try to load another copy from somewhere else on disk than the system directory. Just change the library name to user32.dll only and let Windows pick the right DLL from its system directory.
    Another problem with specifying the full path to a copy of such a DLL is that LabVIEW will think you need to have this specific DLL in a built application and will include it in the build. However your user32.dll is almost 200% VERY incompatible to just about any other Windows system out there, because of Windows version, Service Pack, and bug fix upgrades as well as different language versions of Windows.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • User32.dll Causing Error on Application Exit

    I have an application built into an exe with LabVIEW 8.2. It uses 1 simple call to user32.dll to determine if caps lock is on. When I build the application, it copies user32.dll to the 'data' subdirectory of my application. Everything works fine, however when I exit the program it throws a Windows error, "... has encountered a problem and needs to close..."
    Now the fun part. If I remove user32.dll from this directory, everything works fine. I guess it just goes out and finds the original user32.dll in the system directory and there are no errors when I exit. Replacing the file in \data causes the error again.
    The simplest thing would be to remove the call in my program as it isn't absolutely necessary (it just shows a warning when entering a password if caps lock is on), but there seems to be something weird going on because it only throws the error when using the dll it copied.
    Is there any way to stop the application builder from copying dlls? I couldn't find anything.
    Is there a way to force LabVIEW to release and cleanup any dlls it is using? If I could do this when the user exits, maybe whatever is causing this won't get left behind.

    Marc A wrote:
    I have an application built into an exe with LabVIEW 8.2. It uses 1 simple call to user32.dll to determine if caps lock is on. When I build the application, it copies user32.dll to the 'data' subdirectory of my application. Everything works fine, however when I exit the program it throws a Windows error, "... has encountered a problem and needs to close..."
    Now the fun part. If I remove user32.dll from this directory, everything works fine. I guess it just goes out and finds the original user32.dll in the system directory and there are no errors when I exit. Replacing the file in \data causes the error again.
    The simplest thing would be to remove the call in my program as it isn't absolutely necessary (it just shows a warning when entering a password if caps lock is on), but there seems to be something weird going on because it only throws the error when using the dll it copied.
    Is there any way to stop the application builder from copying dlls? I couldn't find anything.
    Is there a way to force LabVIEW to release and cleanup any dlls it is using? If I could do this when the user exits, maybe whatever is causing this won't get left behind.
    You should not copy system DLLs to other systems. That is a recipy for troubles. Make sure to reference user32.dll form inside the Windows System directory in your Call Library Node. LabVIEW will then see this as system library and not include it in the build. Any Windows system will have user32.dll in the system directory so there is really absolutely no need to distribute that with your app, (and actually it is legally not even correct).
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Where can i find the User32.dll header files?

    Hi
    Is there any way to get the header file and library file of User32.dll or If I want to use a function from a User32.dll where can i get the parameters and arguments for that function which is required to call.
    Thanks & Regards
    Samuel J
    System Engineer
    Captronic Systems
    [email protected]
    Solved!
    Go to Solution.

    Hi,
    In general you don't need "user32.h" because the functions are declared in Winuser.h (you should include Windows.h).
    Otherwise, if you need user32.h only, then you can get this file together with Debugging Tools 
    After install you will get this file at C:\Program Files\Debugging Tools for Windows\winext\manifest\user32.h
    regards,
    Andrey. 

  • How do you use the windows User32.dll Library functions to read variables from other applications that are running

    I am trying to read a text box from a programme running at the same time as my Labview application using calls to the Windows
    User32.dll. I believe I need to find the window handle for the 'form' containing this text string and use this together with
    various other defined input variables to access the sting.
    I have no experience of using this 'Call Library Function Node', but have an understanding of the 'C' programming language. Does anyone have
    example Labview code showing how this might be done.
    Thanks

    If you're trying to access information that's being displayed in the window of another application and that application has no ActiveX interface, then yes, Windows calls can be used. There's a very good example on calling DLLs that ship with LabVIEW. Open the Example Finder (Help->Find Examples) and switch to the Search tab. Enter "Call" in the search box and open the VI "Call DLL". Run the VI, select any of the examples, and click the "Open Example VI..." button. That shows you how to call a DLL.
    Now, given that you have no experience in calling DLLs, have only an "understanding" of C (which to me means you have never written something like a DLL), and don't seem to know that much about what Windows functions you may need, you're going to find this route pretty difficult, especially since you have to deal with Windows API calls, which are not always that easy to do from LabVIEW.
    Let me propose an alternate solution. Go over to http://www.autoitscript.com/autoit3/ and download AutoIt. This is an automation tool that allows you to automate just about anything you want. It has an ActiveX interface that you can call from LabVIEW. I've attached an example VI that shows you how to use it to get the value of a text box from one of the tabs in the computer "System Properties" control panel applet.
    Attachments:
    AutoIt Example (v7).vi ‏25 KB

  • With java how to call a function offered by user32.dll?

    Hi,everyone.
    Please think about my question.Now i want to retrieve all the user's
    information in NT OS.will it be possible? could it be done by calling a method
    of dll? i have tried to define a native method,but i got java.lang.UnsatisfiedLinkerror when i execute the class, what will be the problem?
    can you please offer me a piece of code like it. but the dll should be available with the OS,such as user32.dll,kernal32.dll ...ect, not the one using jni to generate.
    Thank you for suggestions.

    can you please offer me a piece of code like it. but
    the dll should be available with the OS,such as
    user32.dll,kernal32.dll ...ect, not the one using jni
    to generate.You cannot directly call C functions in this way. You have to use JNI. Have your native method written to normal JNI standards call the functions in the OS. Your native method will also have to take care of creating the data structures needed to make the OS call and also creating the Java data structure you want to return.

  • Stand-Alone Application including ocx, dll and Word template folder

    Hi,
    I try to create an Stand-Alone Application with labview 2011. My problem is how i can include ocx and dll file in my executable to be run by others computers (the other computer don't have the dll and the ocx using in the application). My program use Word template who is in a folder. How i can integrated this Template folder in my executable folder.
    This is the first time I create an executable, so please help me -_-.
    Nki
    Solved!
    Go to Solution.

    Hi nki,
    To include the ocx and dll files you will need to build an executable for your VI and then create an installer for the additional files. I have linked 2 documents that will explain each of these steps. If you have any questions with this let me know.
    http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/exe_ex/
    http://digital.ni.com/public.nsf/allkb/E09BA0E2F31D304F86256A640070058E?OpenDocument
    Patrick H | National Instruments | Software Engineer

  • Does anyone have an example VI about how to call the animatewindow function in the user32.dll using CLN in Labview?

      I want to call the WinAPI function-animatewindow in user32.dll to produce some special effect when showing or hidding windows, but i don't know how to using this Win API to achieve my purpose?
      Does anyone have an example VI about this application?
      Thanks in advance for your help.

    You have to use the Call Library Function Node to call Windows API functions. The animatewindow function itself has some pretty simple parameters. You first need to get the window handle. There are a set of Windows API Function Utilities (32-bit) for LabVIEW that you can use. In there there is a VI (Get Window Refnum) that gets the window handle. It's a simple call to a Windows API function. You would call the animatewindow function in the same way. In this case there are 3 parameters: the window handle (returned by a FindWindow API call), a DWORD (32-bit integer) for the duration, and another DWORD for the flags.

  • Including a DLL in JAR file (Comm API)

    Writing a little app that interfaces with serial port device using the communications API and I'd like to bundle it into an executable JAR. JBuilder will create the JAR for me fine, but the issue is with the win32com.dll file thats part of the comms API. I need to include this, I don't think its possible to include as part of the executable, but otherwise the DLL needs to be in the windows\system folder. Could I include the dll as part of the JAR archive and then extract it upon runtime? If so how would I go about this?
    Any help much appreciated.

    There is another option. Native libraries need to reside within the java.library.path location. As it turns out, if you, at runtime, grab this property and ADD your own location to it, then set it back in to the System.setProperty() call, it will NOT work. The only way to do it is the -Djava.library.path value that tjmaven suggested.
    However, if you read up on how a native library is found, it uses the ClassLoader.loadLibrary() which calls the protected findLibrary() method. You can therefore extend ClassLoader to find a path yourself.
    One way is to extend URLClassLoader since it has the protection/security stuff AND the ability to look in .jar files for you. Your custom loader is created by a "launcher" class in your .jar file. First, your luancher uses getClass().getProtectionDomain().getCodeSource().getLocation() to get the absolute location of the .jar file its executing within. From there, you open the jar and look for your native library, extract it using the JAR api to a location of your choosing. Now, you instantiate the custom classloader and using this custom loader instance you load the rest of your classes. The main .jar file contains two classes, the launcher and the custom classloader, and contains the native library if you wish to do it this way. The custom classloader, you specify a URL[] of "classpath" entries. You bundle up the rest of your source in a second .jar file that you pass to the URL[] when creating the custom classloader. It will find all your classes in the 2nd jar no sweat. You can even "reload" these classes on the fly by recreating the custom classloader instance if you so wish to add a sort of "reload" feature.
    Now, in your custom classloader, you override the findLibrary() and return the SAME STRING PATH that you used to unjar your native files to. This way, when the JVM asks your custom loader to load the library at some path, you return the right path to find the native files in.
    I haven't verified that this works just yet, but I will soon. Primarily, my plugin engine over at www.platonos.org will support the ability to place native libraries in plugins, allowing you to effectively wrap a native library use as a plugin. Not yet working, but we'll soon have it in place.

  • User32.dll error in Safari 4

    I installed Safari 4 about a week ago. (previous Firefox user)
    everytime i click onthe Safari icon, either on the desktop,
    or in the quicklaunch toolbar, i get this window:
    *"safari.exe entry point not found"*
    "The procedure entry point IsThreadDesktopComposited could not be located in the dynamic link library USER32.dll."
    I click okay to get out of that window, and then Safari opens as usual.
    Works okay. But I don't know what those error messages are about.
    I've uninstalled and re-installed Safari 4 twice, but problem persists.
    Anyone know why this is happening? And how to correct this?
    thanks!

    Try this link: http://support.mozilla.com/tiki-viewforum_thread.php?locale=en-US&commentsparentId=378981&forumId=1
    The same thing happens with Firefox. The culprit seems be a Vista system32 file called DWMAPI.DLL that should not be in XP system32.
    Do what the link says and it should solve the problem.

  • Trouver les bonton en face avant avec la user32.dll

    bonjour,
    J'ai un petit souci, je cherche a détecter et récupérer (dans une fenêtre qui s'ouvre lors de l'exécution de mon vi principal) le nom des boutons présent sur cette "face avant".
    un exemple vaut mieux que les paroles.
    disont que j'ai mon vi qui appel des exe classique l'un après l'autre. je dois effectuer 2 clic par fenetre avant de fermer celle ci et de passer a la suivante. voyez vous ce que je veux dire, c'est un peu compliquer a expliquer.
    mais grosso modo c'est comme si la fenetre suivant s'ouvrait, il faudrait mettre dans la zone texte un titre, puis cliquer sur enregister, sans que l'utilisateur ne s'en occupe.
    on m'avait parlé de la user32.dll avec les get et les send mais que prendre dans cette grosse lib et quel paramètre.??
    si quelqu'un a une idée
    cordialement

    Bonjour,
    Je vous invite tout d'abord a télécharger le logiciel WinSpy++, celui-ci pourra vous donner la référence vers la commande d'une fenêtre que vous souhaitez piloter.
    Le problème viendra ensuite de savoir si l'executable créé avec LabVIEW utilise bien les contrôles Windows de base ou s'il s'agit d'un contrôle custom. S'il s'agit de ce dernier cas vous ne pourrez pas trouver les boutons en face-avant et je crois que c'est le cas pour LabVIEW (je ne m'en souviens pas).
    Par contre pour un autre logiciel (la calculatrice Windows par exemple) il est très facile de trouver les boutons constituant son interface, il faut alors utiliser FindWindow ou FindWindowEx.
    Je vous invite à regarder cet exemple que j'avais réaliser il y'a quelques années pour piloter la calculatrice de Windows avec LabVIEW : Pilotage Calculatrice Windows .
    Aussi pour avoir plus de renseignement je vous invite à lire le post du forum concernant ce sujet : Integrate an executable on LabVIEW .
    Maintenant si vous avez les fichiers sources (VIs) de l'executable que vous souhaitez piloter avec LabVIEW, vous pouvez utiliser la classe VI Server pour piloter / récupérer des infos sur cette face-avant, ce qui est plus propre et plus fiable.
    Cordialement,
    Da Helmut

  • Force Specific Screen Saver - %windir%\system32\rundll32.exe user32.dll,LockWorkStation

    I am trying to force a specific screen saver using the following in Group Policy.
    Enable screen saver - Enabled
    Force specific screen saver - %windir%\system32\rundll32.exe user32.dll,LockWorkStation
    Password protect the screen saver - Enabled
    Screen saver timeout - 600
    On some computers it works, others it does not and still others show the bubbles screen saver.  I have been unable to figure out why it's not working 100%.  It's as if the local screen saver settings are overriding the domain group policy settings.

    Hi,
    Force specific screen saver - %windir%\system32\rundll32.exe user32.dll,LockWorkStation
    What's the path of this?
    The correct path should be: type the name of the file that contains the screen saver, including the
    .scr file name extension. If the screen saver file is not in the %Systemroot%\System32 directory, type the fully qualified path to the file.
    Local setting was unable to overriding the domain group policy. It might be the group policy was not applied to client. We could use gpresult command on client side to confirm:
    Run "gpresult /h gpreport.html" command to saves the report in HTML format with the file name "gpreport.html" at C:\Windows\System32\ directory.
    Open this file to check if this group policy was applied successfully.
    Also check it on client which worked fine to compare this group policy setting.
    Karen Hu
    TechNet Community Support

  • Don't include kernel32 in my build application

    Hi,
    I have a application thats also uses calls to kernel32.dll. As I like to distribute it to different versions
    of Windows (NT/2000/XP) I don't want Labview to include this DLL in my application.
    I've already tried to change the path name in the "Call Libery Function" form C:\Windows\system32\kernel32.dll
    to kernel32.dll (without the path). But this doesn't work as LV always restored the complete pathname. Adding
    system32 as a libery path doesn't work as well, as LV doesn't allow my to add it as a libery.
    Can anybody help my with this problem?
    Patrick van den Akker
    Philips

    Hi,
    LabVIEW doesn't include Kernel32.dll when you build an application (unless you included it in the build). LabVIEW will always find Kernel32.dll, even if it is not included, because LabVIEW searches the system path (where kernel32.dll will be).
    The path that LabVIEW displays when you configure it doesn't mean this path is fixed. If it is not there, it will search all subdirectories of the exe, the system path and path's added in the system variables.
    So, you can use system API's without worrying about them. LabVIEW will find the API. On MS Windows, of course.
    Regards,
    Wiebe.
    "Patrick@Vision" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I have a application thats also uses calls to kernel32.dll. As I like to distribute it to different versions
    of Windows (NT/2000/XP) I don't want Labview to include this DLL in my application.
    &nbsp;
    I've already tried to change the&nbsp;path&nbsp;name in&nbsp;the "Call Libery Function"&nbsp;form C:\Windows\system32\kernel32.dll
    to kernel32.dll (without the path). But this doesn't work as LV always restored the complete pathname. Adding
    system32 as a libery path doesn't work as well, as LV doesn't allow my to add it as a libery.
    &nbsp;
    Can anybody help my with this problem?
    &nbsp;
    Patrick van den Akker
    Philips

  • I am getting this error message" firefox.exe entry point not found, the procedure entry point is ThreadDesktopComposited could not be located in the dynamic link library user32.dll" before Firefox opens up

    this is the only error message that comes up, then Firefox opens up

    This issue can be caused by a problem with the file c:\windows\system32\dwmapi.dll
    The file dwmapi.dll is a Vista file and should not be present in Windows XP.
    http://support.microsoft.com/kb/969155 - On a Windows XP-based computer with Family Safety installed, you receive an error message: “The procedure entry point IsThreadDesktopComposited could not be located in the dynamic link library USER32.dll”

  • When I click on the Mozilla Firefox icon on my desktop I get a message that says "The procedure entry point is Threaddesktopcomposited could not be located in the dynamic link library USER32.dll.

    When I click on the Mozilla icon on my desktop, I get the error message "The procedure entry point is Threaddesktopcomposited could not be located in the dynamic link library USER32.dll.
    == This happened ==
    Every time Firefox opened
    == I upgraded to the new version of firefox today (7/16/10)

    This issue can be caused by a problem with the file c:\windows\system32\dwmapi.dll
    The file dwmapi.dll is a Vista file and should not be present in Windows XP.
    http://support.microsoft.com/kb/969155 - On a Windows XP-based computer with Family Safety installed, you receive an error message: “The procedure entry point IsThreadDesktopComposited could not be located in the dynamic link library USER32.dll”

Maybe you are looking for

  • Crash of New Logic 9 Install (upgrade from 8)

    Hi everyone sure could use some help. I'm an experienced software engineer and long time e musician. producer and engineer. I finally switched over from the PC to Mac environment and I LOVE it. I not so great at reading mac crash dumps yet. I recentl

  • Passing values to a ProgrammaticSkin

    I it possible to pass values to a programmatic skin? I want to customise the apperance of a button based upon a value, for example in the code below (used to create a custom button) I would like the id value to influence how the skin is drawn.     pu

  • Problem with namespace

    Hi all, I am processing a EDI inbound transactions,using EDI x12 over internet business protocol. I uploaded one XSD file with a name space, but while it cuming to B2B-INQUEUE after processing the inbound transactions , its changing the name space. R

  • Please help me find out my code..I am using msg ACCept and Reject

    Please anyone help me... I am using MSG ACCEPT and REJECT... but my code when I execute it...it keep show out MSG REJECT... Please help me...Thanks a lot.... public class Addmission public static void main(String[] args) throws Exception char Message

  • Documents to PDF issues

    I am having trouble with the end product with documents that are turned in to PDFs. All the coloring is correct when saved, but when PDF'd there is discoloring and "white boxs" that form in the PDF. Any help is appreciated!