PDA

View Full Version : What happens if you are patching a new file?



acoustica
05-04-2010, 01:21 PM
If the new version has a new file, do we manually update the install log so that the uninstall will work properly?

I am using the trial version of Setup Factory and evaluating Setup factory and Visual Patch together.

Thanks!

Ulrich
05-04-2010, 02:04 PM
Hello,

the easiest way would be storing in the registry the info required to locate the Uninstall.xml on the user's computer, created by Setup Factory. Then you would retrieve the location, and read the XML file in, insert the data for the new file(s), and save the updated file.

Here is just an example I made up quickly:

-- load file (you should use a variable to assemble the location of the XML file)
xml = XML.Load("D:\\eSupport\\Uninstall.xml");
error = Application.GetLastError();
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- insert new XML into the document
newdata = [[ <file>
<Filename>C:\\Program Files\\MindQuake\\MyProduct\\newfile.exe</Filename>
<DecrementUsageCount>0</DecrementUsageCount>
<UnregisterCOM>0</UnregisterCOM>
<UnregisterFont>0</UnregisterFont>
<FontDesc/>
<BackupFile/>
</file> ]]

XML.InsertXML("suf70uninstalldata/uninstallfiles/file:1", newdata, XML.INSERT_BEFORE);
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
XML.Save("D:\\eSupport\\Uninstall.new");
end
end

This code excerpt will read the Uninstall.xml, and then insert a node for a new file into the suf70uninstalldata/uninstallfiles section of the XML file. I insert the new file at the beginning of the list of the files to be uninstalled.


Ulrich

acoustica
05-05-2010, 11:20 AM
Ulrich,

Is there a way to know in the patch software that the file does not exist? Or do I have to code this for each new file? Is there an event that is triggered if this file does not exist in the previous version, etc?

Thanks!

PS: Are there any plans for a web deploy in future versions of Setup Factory. I'd pay for the convenience of having it work in Setup Factory. Having 3 programs to manage is powerful, but at the same time unwieldy, imho.