Installing print driver on Windows Azure VM - pdf

We have a native, stand alone Win32 application that we use to generate .PDF files. It is command line driven to take one of our data files in and generate a PDF file. It works in conjunction with a print driver that is installed on the computer.
I know there are libraries for generating PDF files in .NET that we can use in Azure, however, there is specific type layout being carried out in our App that we must support, and that logic is not yet on the server side. This is a short term cheat, before we port (or rewrite) our 20 year old type layout engine out of C/C++. There is alot of code here with alot of complexity.
I see that we can now run native apps in Azure (yay). However, my issue seems to be that this native application requires a print driver installed. I have not been able to find any information about installing print driver in Azure worker role.
I found this discussion: https://stackoverflow.com/questions/9125385/printing-to-pdf-from-azure-worker-role. The end result of this is to use a PDF library on Azure, which is not something that will work for us.
Also, I am aware that it is not the best use of a server to fire up a process to generate a PDF file everytime somebody wants to preview their data file in our web site. We are planning on cheating by showing the user the PDF, when they want to preview our proprietary data format in a browser. This is Phase I of a project, and rewriting our 20 year old type layout engine in C# is going to take alot longer to accomplish, and we are talking about this (admitted hack) as a short term (in the bigger sense of things) measure.
How do I install a Print Driver in Windows Azure worker role? Is it possible? Are there any other options?
Many Thanks.

If you can do a command line, silent install of the Amyuni software that yms mentioned then you could run that as part of a startup task on your worker role, probably with elevated permissions. People use startup tasks to do all sorts of things and many of them have written blog posts about it or answer questions about them here on SO, but a good place to start would be the official documentation.

This may help: Amyuni PDF Converter is a PDF printer driver with an API exposed as a COM interface and as a net. assembly that allows you to silently install and uninstall the driver programmatically. This can be done by using the methods PDFDriverInit and DriverEnd from your application.
Once your application installs the driver, you can print to PDF using a memory stream as destination and upload it to a Microsoft Azure Blob Storage.
There are 2 ways of installing Amyuni PDF Converter:
1- Using the installation program provided with the package.
2- Copying the dll files to their corresponding folders and then calling the method DriverInit.
The complete process is explained here:
Using the Developer Version of the Amyuni Document Converter
About your specific scenario, if you have an application that uses Amyuni PDF Converter, then there is indeed a printer driver that should be installed with it. Your application could be installing the driver every time it is launched and removing it when it is closed, or it could be installing it only during the installation of your program.
If you do not have the source code of this application but you still have the license information of the library provided by Amyuni, you could try building a small application or batch script that just takes care of the installation process. You can contact Amyuni support for a link to the latest build of the version you are using.
You mentioned that you are using Windows Azure VM, so I am assuming that you have administrative rights on the virtual system and that you can connect to it using remote desktop and run any kind of applications.
Usual disclaimer applies

Related

Creating automated Installer for any Program

How can I create an automated Installer for a program that has a regular Installer with questions like:
Install Directory,
Accepting License,
Creating Icon on Desktop
etc...
Assuming that I am OK with building an Automated Installer for every program I want to separately, Or i want to put files in a Self Extracting Archive and run the Installer after unpacking.
Do I need a third party program for it? Should I use Command Prompt? Do I need to learn Lua? (I'm learning C#)
EDIT:
To clarify I'll use an example:
Let's say i wrote a program but that program has a requirement, like
DirectX, or Adobe Air, or Maxthon Browser.
I wrote my program in such a way that I have to be sure that that is
installed in a very specific Drive/Folder on the PC or with some
specific preferences/parameters.
I include an installer for this program, but I want to specify where
it gets installed on the PC and with what parameters.
Preferably Installing this requirement right after or during the
Installation/Extraction of my own program.
I'm looking for a way to be able to run the Installer of any given program and navigate through the install wizard of it with out the user having to/being able to change the settings I need (with the foreknowledge and permission of the user of course).
It doesn't need to be silent install or anything.
I have rewritten my answer.
Your mentioned setups requirements seem very common to me for the class of installation programs (setups) and not at all unusual.
Generally you have two options:
You write everything on your own, you create the install dialogs, the way the settings are saved, and so on. Then you are fine with C# (or any other language).
It is quite uncommon to do so, because it is time consuming, and you are reinventing things which have been solved in standard ways several times. Moreover you will fall in common setup error traps which are maybe already captured (or at minimum documented) if using tools.
If you want to use a tool, it is your first decision, if you want a tool based on MSI (Windows Installer) or not. MSI is the most powerful and most industrial-accepted setup technology in Windows, but it is a quite complicated matter, and no tool can shield this 100% from you. Google for WiX (Open Source) or InstallShield as starting points for MSI tools but there are of course more.
Some tools are already integrated or integrateable in Visual Studio for example.
Selfextracting tools are a starting point, but the following tools offer far more and are a good intermediate way between the extreme points SFX and MSI:
InnoSetup
(has also a home here on SO).
Nullsoft Scriptable Install System (NSIS) on SourceForge
One self extracting program in Windows I want to mention, because it is not widely known, that "IEXPRESS.exe" is already included in the OS.
Concerning your special question of navigating through the install wizard:
Every mentioned tool has ways to save install settings and of course is deciding which settings are changeable by the user part of the 1*1 of setup creation. With the tools you can design the install dialogs like you want consisting of the parts you want.
I hope I got your point.
P.S. While most tools have kind of a scripting language or something similar included, you are normally free to extend the installation process with your own actions written in nearly every programming language you like.

Distributing TideSDK application

I recently finished an application based on Titanium, Javascript, HTML, CSS. I have only been a web designer to date so I have little experience in distributing applications. I was accustomed to the TiDev Community deploying app, which prepared the app for download and made it available for download at a given link.
But tidev community is no longer supported, so I use TideSDK Developer to package the app, which doesnt do all the hard work the other one did so nicely.
I am obviously a complete rookie to this.
Could anyone outline the steps I would need to take to go from the bundled application folder I have now (put together by TideSDK Developer), to a link that will allow customers to download and install the app or online? I know there is an issue with packaoging the app for platforms other than your own, and that appcelerator is working on a solution to this I think. I also realise I would probably have to pay to host the download online. Any guidance would be greatly appreciated.
You must use the tidebuilder.py script. to compile a installation package. To compile a binary for a Mac, you must run the script on a Mac, to compile a binary for windows, you must be on a windows box etc.
There is some documentation on how to use it here per platform. The command is very simple and works.
Once you have your application file (DMG for OSX or a MSI for Windows) then just distribute it however you see fit, email, putting it on your web server, whatever works for you.

Specific examples of vSphere SDK for .NET

The vSphere SDK for .NET developers pdf has a sample that describes how to connect to Vcenter and perform operations such as power-off, reboot etc.
I need specific examples for changing VM configuration such as disk, memory, CPU etc as well as migration through Storage VMotion and cloning.
The vSphere PowerCLI admin guide has specific examples to the above using command line in Powershell but there are no corresponding examples in C#. Has anyone attempted these operations in C#?
The vSphere SDK for .NET comes with many samples for performing various operations.
The samples, however, need to be rebuilt using a supplied batch file(s).
Here's how it is done:
Navigate to the path: VMware-vSphere-WS-SDK-4.1.0-257238\SDK\samples\DotNet
Under this path, you will find various batch files, such as: Build2005.cmd and
Build2008.cmd
There's also a readme_dotnet.html, but it seems outdated.
Open a Visual Studio command line window.
Navigate to the samples\DotNet folder.
If you have installed VS in a non-default location, fix up the environment variable prior to beginning:
"set the environment variable VSINSTALLDIR to the directory containing the 2 directories "Common7" and "SDK"." Please remember to use quotes around directory names that have spaces in them.
Execute Build2005.cmd or Build2008.cmd (for VS2005/2008).
This will create a "cs" folder with all relevant samples (58 projects).
Hope this helps!
Lior
I've played with a number of VMWare API's and I've settled on VSphere SDK for .NET also. It's not perfect but it's the best I've found so far. As far as samples, since the PowerCLI cmdlets are just wrappers for the underlying .NET classes I tend to google for PowerCLI examples and then port that over to C#.
It seems strange that when I go to the website for code samples they simply don't have a category for this SDK. They only have samples for the SDK that's a bunch of .net class source files based on WSDL.

how to upgrade compact framework applications?

i'm looking for a way to manage application upgrades for my compact framework app.
let's say i have v1 of the app installed on my device, and v1.1 has been released. I want the app to make a call to my server to see if there is a new version. since a new version is found, i want to send down the new version of the app to the device and have it installed, replacing the old version.
my first thought was just to have the app download the .cab file and kick off the cab file just before exiting the app. this would mostly get the job done but it would prompt the user to pick the installation location if they have a storage card or other partitions on their device. i would like to prevent any user input and just have the new version of the app installed, replacing the old app.
i'm certain that there are others doing this already and i don't want to reinvent the wheel, here. what application management tools and systems exist for this type of process? how can I facilitate this type of process?
...
EDIT:
in spite of my previous searches before posting this, i just now found this question: How to Auto-Update Windows Mobile application
When I wrote one I relied on launching the .cab file. It was definitely the path of least resistance.
Otherwise, I'd write a simple "upgrade.exe" executable that gets distributed with your app. When upgrading, you'd download the new package, launch your upgrade.exe just before exiting your app, then have that program copy over the new files to your app.

Windows CE Device: Deploy using a .zip or a .cab on headless device?

I have a Windows CE device that we are deploying, but we have complete control of the software installed on it.
This is not a typical Windows Mobile device, this is a headless device that the user will not interact with. I know that on PDA-style WinCE devices, the .cab file is the preferred application distribution method.
However, on a headless device, we will be writing some type of upgrade/patch server that will ping a server for updates, download them, and auto-install when they are available.
Do I still want a .cab file, or is a .zip (or even something else) better?
What are the requirements for a .cab file - what kind of restrictions / requirements might get in the way and be an annoyance? What are the benefits?
I'd stick with CAB as a package since even headless devices can use the CAB extraction tool. If you ZIP it, then you have to add a ZIP support library and app. CAB also has the ability to add registry entries and define far more disparate target locations than a zip (I want x.dll in \Windows but prog.exe in my program folder - try that with a ZIP).
One thing to keep in mind is that wceload (the CAB extractor) uses a UI by default, so you're going to want to use things like the /noui switch for it.
If you're true headless this may not be an issue (not done that in a long while) but a fairly common "headless" configuration has display support and either the display simply isn't hooked up or is something like a NOP VGAFLAT driver. This allows you to run a shell and have access to all the nice shell APIs, but adds to the challenge that GWES will render dialogs onto the non-existent display.
OpenNETCF also has a CAB Installer SDK that you can use to completely remove any UI with by creating your own installer app. This may or may not be useful depending on the how and when the install happens (through HKLM\Init or otehr for example).