From f38c944c37a176b10217ca9b3a9c7a8103e59458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20=C5=A0taleker?= Date: Fri, 20 Mar 2026 13:34:20 +0100 Subject: [PATCH] publis samo v verzjo --- InfosysPublisher/InfosysPublisher.csproj | 2 +- InfosysPublisher/WinMain.xaml | 11 +++++++--- InfosysPublisher/WinMain.xaml.cs | 26 ++++++++++++++++-------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/InfosysPublisher/InfosysPublisher.csproj b/InfosysPublisher/InfosysPublisher.csproj index 33b6d68..245b702 100644 --- a/InfosysPublisher/InfosysPublisher.csproj +++ b/InfosysPublisher/InfosysPublisher.csproj @@ -5,7 +5,7 @@ net8.0-windows7.0 enable true - 2025.02.26.0 + 2026.03.20.0 infosysPublisher.ico diff --git a/InfosysPublisher/WinMain.xaml b/InfosysPublisher/WinMain.xaml index 8085e71..98596ad 100644 --- a/InfosysPublisher/WinMain.xaml +++ b/InfosysPublisher/WinMain.xaml @@ -44,12 +44,17 @@ + - + - Pripravi samo zip - + + Pripravi samo zip + Publish vsem (vsi brez licence dobijo verzijo) + + + diff --git a/InfosysPublisher/WinMain.xaml.cs b/InfosysPublisher/WinMain.xaml.cs index f0923b8..0ac2a44 100644 --- a/InfosysPublisher/WinMain.xaml.cs +++ b/InfosysPublisher/WinMain.xaml.cs @@ -244,7 +244,8 @@ namespace InfosysPublisher .GetElementsByTagName("variable") .Cast() .FirstOrDefault(x => x.Attributes != null - && x.Attributes.Cast().Any(y => y.Name == "name" && y.Value == "AplikacijaGuid")); + && x.Attributes.Cast().Any(y => y.Name == "name" + && y.Value is "AplikacijaGuid" or "GuidApplication")); if (node != null) tmpSelectedProjectGuid = node.Attributes["value"].Value; @@ -361,6 +362,8 @@ namespace InfosysPublisher return; } + var publishToAll = ChbPublishToAll.IsChecked ?? false; + //InfosysUpdate //v&H6c$wTbTkgSgdWvL*8k$st3#z5X var error = ""; @@ -417,7 +420,7 @@ namespace InfosysPublisher File.Delete(tmpXmlFile); } - if (xmlVersion != "") + if (publishToAll && xmlVersion != "") { var projectArchive = sftpServer.SftpArchivePath + "/" + _selectedProjectPublishLocation; if (!sftpClient.Exists(projectArchive)) @@ -455,12 +458,16 @@ namespace InfosysPublisher var genPublishLocation = _selectedProjectPublishLocation + "/" + "Package.zip"; var genPublishLocationTmp = _selectedProjectPublishLocation + "/" + "Package_tmp.zip"; - using (var fileStream = new FileStream(zipPath, FileMode.Open)) + if (publishToAll) { - sftpClient.UploadFile(fileStream, genPublishLocationTmp, - true); + using (var fileStream = new FileStream(zipPath, FileMode.Open)) + { + sftpClient.UploadFile(fileStream, genPublishLocationTmp, + true); + } } + var sftpDirVersion = _selectedProjectPublishLocation + "/" + _selectedProjectVersion; if (!sftpClient.Exists(sftpDirVersion)) @@ -475,18 +482,21 @@ namespace InfosysPublisher true); } - if (sftpClient.Exists(genPublishLocation)) + if (publishToAll && sftpClient.Exists(genPublishLocation)) sftpClient.DeleteFile(genPublishLocation); if (sftpClient.Exists(versionPublishLocation)) sftpClient.DeleteFile(versionPublishLocation); - sftpClient.RenameFile(genPublishLocationTmp, genPublishLocation); + if (publishToAll) + sftpClient.RenameFile(genPublishLocationTmp, genPublishLocation); + sftpClient.RenameFile(versionPublishLocationTmp, versionPublishLocation); //XML na koncu - using (var fileStream = new FileStream(tmpXmlFileUpload, FileMode.Open)) + if (publishToAll) { + using var fileStream = new FileStream(tmpXmlFileUpload, FileMode.Open); sftpClient.UploadFile(fileStream, _selectedProjectPublishLocation + "/" + "Update.xml", true); }