VB 2013 Embedded resources - vb.net

I just wanted to get clarification on the approach I'm taking with my program. I'm making a program with custom interface for achiving folders. I would like to use 7zip if possible. In the past I have written batch scripts to that use 7zip command line for archiving. If I want to use my VB tool on a system that doesn't have this available, I would like for this to be embedded in my app.
My question is that know how to embed an exe in a VB app, but does this make it immediately available for use in the program no matter where I use it? Or it make the exe available to be deployed somewhere on the station, then I would have to call it from the disk and then possibly delete it when I'm done?
I've done some searching online for similar applications, but am still unsure of how to use embedded files. I'm not looking for example code. Just clarification on whether I can immediately call the exe from within my app, or I embedding just means I can place that file somewhere on the station that I move my app to and then use it? Clarification on this would be most welcome. Thanks!!!

Related

Is it possible to embed a manifest file inside the executable of a VB.NET (VS2010) project?

I'm currently working on a small VB.NET app on VS2010, and it seems that setting the "dpiAware" field on True in the project's manifest file is the only way of having the program not come up as a blurry mess on newer PCs.
The thing is, i really need (not allowed to explain why) to have this setting "packed" in the executable and not have it in a separate file that needs to come along with it.
After some research, it seems to be possible to embed the manifest file inside the exe file, but the instructions in my case are often unclear due to being written for newer versions of VS and/or different languages. Maybe it's even possible to change the dpiAware field in-code and not having to mess with external files, i'm not really sure.
Hopefully some of you had some experience in this department.
Any help would be greatly appreciated.
Thanks in advance !

How to update dll/plug-in without restarting AutoCAD?

I have a class library dll that loads AutoCAD scripts from a network folder. However I need a way to ensure the class library can be updated silently. With Windows Form applications I would just use a ClickOnce Deployment and then use Application.Restart, however as this has to be a Class Library (as it is an AutoCAD addon) this doesn't seem to be possible.
What's the best way to handle this?
This is not possible with AutoCAD plugins because the DLL is loaded in the AppDomain. This 'silent' update is possible only with C++.
You can go the TDD way which is good practice. Here is a handout on the topic because TDD in AutoCAD is not that easy because of the above mentioned problem.
You can try to develop you algorithm in your own classes in order to have better TDD experience. Then transfer it with DTOs to AutoCADs transaction.
Some developers have 2 (or more) DLLs with AutoCAD code: the 1st main DLLs loads on AutoCAD startup, check for updates, download and install. The 2nd DLL actually contains the commands that will be demand loaded when the user run the command.
I recently built a solution that allows reloading the same copy of a .dll into AutoCAD.
Check out my blog with the full solution:
http://www.cadwiki.net/blogpost/How-to-reload-a-.dll-into-AutoCAD

Turn Outlook VBA into a standalone script

I've written some VBA which accesses the users Outlook notes and contacts, performs some manipulations, modifies the notes and contacts and at the same time outputs some text files. It works very well.
At present it runs (like all other VBA code) inside Outlook by doing Tools > Macro > Macros... however installation is a pain for non-tech savvy users to do and given that is is a simple BAS module (no forms), it doesn't really need to be run in this way.
A script file which could be executed by double-clicking within explorer would be a far better option. This would be easier to re-distribute and mean that anyone could use it.
Assuming it is possible to turn the VBA into a standalone script...
How do I do it?
What should I also know? Any caveats or things to be aware of? Any code I'll need to change?
Thanks.
I realize this post is old, but is a VB6 COM DLL an option?
Here's a simple example of what you can do:
http://support.microsoft.com/kb/316983
And you can use an installer like Inno Setup to create an EXE which would install and register the DLL on each computer.

Programmatically accessing an application through its UI

Earlier I asked a question about command-line parameters to automate processing of a file in InfoPath. I'll probably get the Tumbleweed badge for that one.
Instead of attempting a batch solution through the command line, can someone suggest a good resource for developing a solution that will open an application and then perform actions through the application's user interface like opening a file, printing it, and closing the file?
I've seen a legacy application do this in the past where it would open Attachmate and perform I/O operations through Attachmate's interface - but I never saw the code.
One constraint is that the process will be initiated from an existing .NET solution (i.e. processing 10,000 files). I am also unable to rely on traditional Office macros like those found in Excel - InfoPath does not appear to support them.
One option for automating a GUI based application is to use AutoIT. It will allow you to script the actions that are necessary for clicking menu interfaces, working with dialogs, etc.
Depending on your needs, you can create an AutoIT script on your dev machine, compile it to a standard EXE, and deploy it with the .NET project's compiled artifacts. To pass data to it, either you have your AutoIT script take command line parameters, or you have the .NET solution write a to a file with all the input file parameters and have the AutoIT script read in the file to process it. Based on the number you have in the question, I'd go with the option of writing to a file.
Since you are already on .NET you might want to give the new UI Automation framework a try. I haven't tried it yet, but it is supposed to work with WPF and native Win32 applications.
MSDN also has some samples: UI Automation Control Pattern Samples
Attachmate has a scripting language, an API and all kinds of other stuff to help with automating it. So this may not have been a typical application.
On the other hand, Attachmate products are (IMO) horrible to the extreme and I will go to great lengths to avoid working with them in the first place.

are there best practices or tricks for indexing/monitoring a drive for files?

I need to find and monitor all the photos on a hard drive or a folder for a photo organizer. Currently I'm doing this naively: recursively traversing, manually marking folders as indexed, and repeating that process to catch when photos are added or moved.
The problem is with a large enough folder tree this is very expensive, so I'm looking for tips to do this differently and/or tips on keeping it a low cpu process.
Ideally solutions would be not platform-dependent.
EDIT: I'm using xulrunner currently, but could compile a module do platform specific stuff.
What about the first run? Is there no solution (even platform-dependent) besides running through the entire folder tree manually.
Ideally solutions would be not platform-dependant.
Impossible. The Win32API has FindFirstChangeNotification, Linux has inotify (and others), Mac OS X has FSEvents, et cetera. This is stuff that's very low-level, and no OS does it the same as any other OS. If you want something cross-platform, you have to find an API with several backends that works on the platforms you want, but if there are any of these, I haven't yet found them.
I don't know of a way to do this in a platform independant way, but on Linux I'd hook into inotify to call something when a file gets added or updated. You could even use inotify-tools to run a script when that happens, so you don't have to be running all the time to capture all these events if they're infrequent. Just have the script update the database, and optionally notify your gallery/display program if it's running.
Are you coding on .NET? If so, you could use the FileSystemWatcher class instead.
Why not user a filewatcher program, which will notify you of changes in particular folder trees?
If you want to write your own you could use the FileSystemWatcher class to do it.
One answer as of 2014 is facebook's watchman: https://facebook.github.io/watchman/
A couple of years ago I ported some functions of Windows API to Linux like (FindFirstChangeNotification, FindCloseChangeNotification ...) it has some limitations but for what you need it could be enough, please take a look at: https://github.com/paulorb/FileMonitor