Revision: 1587
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1587&view=rev
Author:   rorthomas
Date:     2011-01-18 15:20:59 +0000 (Tue, 18 Jan 2011)

Log Message:
-----------
renamed installer to updater

Modified Paths:
--------------
    trunk/source/updater/CMakeLists.txt
    trunk/source/updater/ConfigManager.cpp
    trunk/source/updater/wizard.cpp

Modified: trunk/source/updater/CMakeLists.txt
===================================================================
--- trunk/source/updater/CMakeLists.txt 2011-01-18 14:32:50 UTC (rev 1586)
+++ trunk/source/updater/CMakeLists.txt 2011-01-18 15:20:59 UTC (rev 1587)
@@ -81,15 +81,15 @@
 # we dont need to add ${Boost_LIBRARIES} here, could be wrong as well ...
 
 IF(WIN32)
-   add_executable(installer WIN32 ${source_files} ${include_files} 
${resource_files})
+   add_executable(updater WIN32 ${source_files} ${include_files} 
${resource_files})
    # no more static linking :/
    #SET_TARGET_PROPERTIES(installer PROPERTIES COMPILE_FLAGS "/bigobj /MT /MP")
    # TODO: fix UAC and VS2010
-   SET_TARGET_PROPERTIES(installer PROPERTIES LINK_FLAGS    
"/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"")
+   SET_TARGET_PROPERTIES(updater PROPERTIES LINK_FLAGS    
"/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"")
 ELSE(WIN32)
-   add_executable(installer ${source_files} ${include_files} ${resource_files})
-   TARGET_LINK_LIBRARIES(installer ${Boost_LIBRARIES})
+   add_executable(updater ${source_files} ${include_files} ${resource_files})
+   TARGET_LINK_LIBRARIES(updater ${Boost_LIBRARIES})
 ENDIF(WIN32)
-TARGET_LINK_LIBRARIES(installer ${wxWidgets_LIBRARIES} ${CURL_LIBRARIES})
+TARGET_LINK_LIBRARIES(updater ${wxWidgets_LIBRARIES} ${CURL_LIBRARIES})
    
 

Modified: trunk/source/updater/ConfigManager.cpp
===================================================================
--- trunk/source/updater/ConfigManager.cpp      2011-01-18 14:32:50 UTC (rev 
1586)
+++ trunk/source/updater/ConfigManager.cpp      2011-01-18 15:20:59 UTC (rev 
1587)
@@ -390,6 +390,11 @@
                        // rename ourself, so we can replace ourself
                        LOG("renaming self...\n");
                        std::string myPath = conv(getExecutablePath());
+                       
+                       // removing old, otherwise renaming trows exception
+                       
if(boost::filesystem::exists(myPath+std::string(".old")))
+                               
boost::filesystem::remove(myPath+std::string(".old"));
+                       
                        boost::filesystem::rename(myPath, 
myPath+std::string(".old"));
 
                        LOG("downloading update...\n");

Modified: trunk/source/updater/wizard.cpp
===================================================================
--- trunk/source/updater/wizard.cpp     2011-01-18 14:32:50 UTC (rev 1586)
+++ trunk/source/updater/wizard.cpp     2011-01-18 15:20:59 UTC (rev 1587)
@@ -201,8 +201,11 @@
                                   autoUpdateEnabled(_autoUpdateEnabled)
 {
        // first thing to do: remove old installer file if possible
+       try
+       {
        if(boost::filesystem::exists("updater.exe.old"))
                boost::filesystem::remove("updater.exe.old");
+       } catch(...) {}
        // now continue with normal startup
 
        new ConfigManager();


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to