Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863

    Auto Update %ProductVer%

    Here's a little code snippet that I use in most of my installers.

    Typically; you change the version # in SUF to reflect a new version of your installer.

    What if you want this version to auto-update with your main application file?

    Put this in an included LUA script file or global functions:
    Code:
    function SetupData.GetInternalFileVersion( cFileName )
    	local tFiles = SetupData.GetFileList(ARCHIVE_LIST);
    	local cVersion="0.0.0.0";
    
    	if type(tFiles) == "table" then
    		local x;
    		for x = 1, Table.Count(tFiles) do
    			 if String.CompareNoCase(tFiles[x].FileName, cFileName )==0 then
    				cVersion = tFiles[x].FileVersion;
    				break;
    			end
    		end
    	end
    	return cVersion;
    end
    Now in your "On startup" add this line:
    Code:
    SessionVar.Set("%ProductVer%", SetupData.GetInternalFileVersion("MYAPP.EXE") );
    For large installs, this does add a noticable install; but for most; it's quick enough.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  2. #2
    Join Date
    Jan 2011
    Posts
    2

    Auto Update Producct version to uninstall link

    How can I do if i build a new version, for example from 1.0 to 2.0, in the ad or remove programs is a new link for the new version but a need to be autoupdated

  3. #3
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    The same approach that Josh gave here would work. However you should note that, if you reinstall the product using a different version number in the shortcut of the Control Panel, you will be creating a new shortcut instead of overwriting the existing one. For this reason it might be best to suppress the number completely - or you must perform an automatic uninstall before installing the other version. You should avoid stuff like this:

    SNAG-2011-01-15-01.png

    You can also use my FileVersion utility, or tools like Kinook's Visual Build to extract the version number and pass it to Setup Factory as a build constant.

    Ulrich

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts