diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 8b31e964a..d262ad3c4 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -97,6 +97,7 @@ Public ProfileIndex As Integer Public BreakOnError As Boolean Public Running As Boolean +Public JustUpdateVersion As Boolean 'Private Recent As New String[] 'Private RecentDate As New Date[] @@ -270,6 +271,13 @@ Public Sub Main() Else If sArg = "--version" Or If sArg = "-V" Then Print Application.Version Quit + Else If sArg = "-u" Then + Project.JustUpdateVersion = True + Project.Dir = Args[iInd + 1] + Project.Path = Project.Dir &/ PROJECT_FILE + Project.ReadProject(False) + Project.Exit + Quit Else If Left(sArg) = "-" Then Error "gambas3: unknown option: " & sArg Quit @@ -3197,11 +3205,15 @@ Public Sub ReadProject(Optional bConvert As Boolean) Startup = sVal Case "component" - hComp = CComponent.All[sVal] - If hComp And If Not hComp.Hidden Then + If JustUpdateVersion Then Components.Add(sVal) Else - aMissing.Add(sVal) + hComp = CComponent.All[sVal] + If hComp And If Not hComp.Hidden Then + Components.Add(sVal) + Else + aMissing.Add(sVal) + Endif Endif Case "library" @@ -3425,6 +3437,7 @@ Public Sub ReadProject(Optional bConvert As Boolean) Close hFic VersionFile = Not GetVersion(True) + If JustUpdateVersion Then Return If aMissing.Count Then sMsg = Subst(("Some components are missing: &1"), aMissing.Join(", ")) @@ -3480,17 +3493,21 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak If Project.ReadOnly Then Return - If Type - ' If bMakeShortcut Then - ' If Project.CreateShortcut Then - ' InstallComponent - ' Else - ' UninstallComponent - ' Endif - ' Endif - Else - MakeShortcut(bMakeShortcut) - If Not bComponentDoNotChange Then RefreshComponents + If Not JustUpdateVersion Then + + If Type + ' If bMakeShortcut Then + ' If Project.CreateShortcut Then + ' InstallComponent + ' Else + ' UninstallComponent + ' Endif + ' Endif + Else + MakeShortcut(bMakeShortcut) + If Not bComponentDoNotChange Then RefreshComponents + Endif + Endif ' Creates the .project file @@ -3581,6 +3598,8 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak Try Kill sPath Move sPath & ".tmp" To sPath + + If JustUpdateVersion Then Return WriteProjectTranslation UpdateComponentFile