Page 1 of 3
Patching from a separate project
Posted: Mon Nov 20, 2006 8:09 am
by nic2006
hi
I have created a project in installaware, and decided to use the automatic updates feature to distribute the installer.
The current project has a lot of excess info that i do not want to occur when i update it or patch it, therefore i created a separate project that only inlcudes the files that need to be updated.
I made the product and update product codes the same for both projects, and deployed the patch project to the monitor website. But when i schedule the update on the machine nothing happens...
It doesnt seem to pick up that an update is needed.
If i create a patch in the same project (original project), then it picks up that an update is needed.
Is there something that i am doing wrong, and am i correct in creating a separate patch project?
Posted: Mon Nov 20, 2006 9:34 am
by nic2006
Actually the real issue here is how to get some sort of status or info back from the scheduled install if the install was successful or not.
I mean is it possible to create a log file or something for the scheduled install, because the update/patch runs and then it just finishes, when i check my install folder the contents have not changed at all.
Posted: Mon Nov 20, 2006 10:33 am
by MichaelNesmith
Why not run the patch interactively and see what happens?
Posted: Tue Nov 21, 2006 6:08 am
by nic2006
Actually i did run the patch interactively, and i specified the temporary folder where the contents are extracted. The installer completes successfully but the contents of the install directory have not changed.
What i did was to add a new file to the patch install (which is absent from the main install). So if i run the patch then it it should add the new file, right... but it doesnt.
Any help would be much appreciated, as i am running out of ideas...
Posted: Tue Nov 21, 2006 6:47 am
by MichaelNesmith
Did you add the new file to the correct region in the MSIcode? Make sure it is not being excluded from the patch process by the patch compiler directives - try adding right below [OFFLINE FILES] in your script to see if that helps.
Posted: Tue Nov 21, 2006 8:59 am
by nic2006
The new file is automatically added in the [OFFLINE CONTENT] region before the Apply Patch command. I moved it after the apply patch and at the top of the offline content but no change.
I also noticed that the patch gives me errors when i try run it interactively the error message says "Verify that the file exists and that you can access it", but the installer is looking in the wrong folder for the specific file. Two temp folders are created and i specify the one where the file exists but it still looks in the incorrect folder (anyway not sure whats happening there).
Unfortunately though the contents of the installer have not changed after the patch...
Posted: Fri Nov 24, 2006 8:46 am
by nic2006
ok i havent had any luck, so i decided to go back to basics.
I created a project with one text file in it. I deployed this on a machine and set the schedule.
Then i created a patch in the same project, but i added a new text file (so there are two text files now). I put this on the location i specified in the monitor url.
When it was time for the schedule to run, it picked up that an update was needed, but when i ran it nothing happened (as before).
So i ran it interactively, specifying the correct temp folders. It actually ran but now when i look at my installation folder there is only one file there and it is the newly added text file from the patch. What happened to the original text file???
Posted: Fri Nov 24, 2006 8:50 am
by nic2006
By the way, this issue is fairly urgent. So far i have been relatively pleased with the installer but this patching process is making things difficult, any suggestions or ideas would be much appreciated...
Posted: Fri Nov 24, 2006 10:37 am
by MichaelNesmith
I think trying to patch from a separate project is stretching things, and this might be the cause of your problems.
Patches are, by design, intended to update existing projects only, and additionally, they patch existing files, not new ones.
A user had previously reported that he was able to have a patch install new files, so I gave him the benefit of the doubt and assumed that might be possible; but ordinarily this is not the case.
You really need to stick to the basics with patching - if you want to install new files, do that directly using CopyFileA in kernel32.dll with Call DLL Function, for instance. But for your patches to work without headaches, follow these golden rules:
a) Stick to the same project template when patching as the original installer
b) Add the old versions of your product as patch references - all old versions that you want to patch against
c) Do not expect patches to install new files, but just update existing files - if you have to install new files, do so manually
d) If you have to change product codes, revision codes, upgrade codes - be sure you know what you are doing
The IDE makes it as easy for you as possible by offering one-click out of the box patching. But if you are diving in and customizing things, you need to know what you are doing, and in most cases find your way by trial and error.
InstallAware protects you from virtually all internal details of Windows Installer, but not if you are fighting its built in behavior (such as patching from a different project) - then you are pretty much forcing yourself to get involved in rocket science.
Posted: Mon Nov 27, 2006 4:46 am
by nic2006
ok i think i understand a little better.
I have ONE project, i create a patch, i did this with a simple text document where i change the text inside the document between the original and patch version.
If i run the patch using the updater i.e. automatically then nothing happens, only if i run it interactively then it works (but this is NOT feasible for our current setup, must be run automatically).
Also is there a variable that i can use to test in the code whether a patch is running, so as to not do all the extra steps needed in the main installation when running a patch (is NEEDSUPGRADE the correct variable).
Posted: Mon Nov 27, 2006 8:17 am
by MichaelNesmith
Try to use logging to see why automatic patch installation fails, in that case. You usually do not test if a patch is running at runtime, because a patch is made a patch at build time, by the compiler variables that are used in the script (BUILDMODE=PATCH).
Posted: Mon Nov 27, 2006 8:29 am
by nic2006
Sorry i realised after i made the post that there was a COMPILER IF VARIABLE BUILDMODE EQUALS PATCH.
How do i activate logging for the automatic patch updates?
Posted: Mon Nov 27, 2006 8:31 am
by MichaelNesmith
Same as any other setup - /l command line parameter. Full description of supported command line parameters is well documented in the help files.
Posted: Mon Nov 27, 2006 9:11 am
by nic2006
Ok i assume that the command line /l parameter is put in the UPDATE PACKS section (e.g. /l=c:\\log.txt).
If this is correct, then i tried to run the installer automatically again, but still nothing happens. The log file is not even written (what am i doing wrong)...
How will i know that the installer completes successfully, it says its busy installing but then the icon in the taskbar just disappears??
Posted: Tue Nov 28, 2006 2:38 am
by nic2006
Unfortunately i have not been able to get the patch working or get a log file...
Another question...
I have created a custom dialog in my setup that requires a user to enter a username and password. If i run a patch in silent mode, what will happen with that dialog, can it be run with default values or how do you get the user to enter that info.