publis samo v verzjo

This commit is contained in:
David Štaleker
2026-03-20 13:34:20 +01:00
parent 5a0c6bff65
commit f38c944c37
3 changed files with 27 additions and 12 deletions

View File

@@ -5,7 +5,7 @@
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<AssemblyVersion>2025.02.26.0</AssemblyVersion> <AssemblyVersion>2026.03.20.0</AssemblyVersion>
<ApplicationIcon>infosysPublisher.ico</ApplicationIcon> <ApplicationIcon>infosysPublisher.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>

View File

@@ -44,12 +44,17 @@
<TextBox Grid.Row="7" Name="TbOutput" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" IsReadOnly="True"></TextBox> <TextBox Grid.Row="7" Name="TbOutput" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" IsReadOnly="True"></TextBox>
<Grid Grid.Row="8" Margin="3"> <Grid Grid.Row="8" Margin="3">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80px"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="80px"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Grid.Column="0" Name="BtnSettings" Width="80" HorizontalAlignment="Left">Nastavitve</Button> <Button Grid.Column="0" Name="BtnSettings" Width="80" HorizontalAlignment="Left">Nastavitve</Button>
<CheckBox Grid.Column="1" Name="ChbCreateOnlyZip" Width="180" HorizontalAlignment="Left" VerticalAlignment="Center">Pripravi samo zip</CheckBox> <StackPanel Grid.Column="1" Orientation="Horizontal">
<Button Grid.Column="1" Name="BtnPublish" Width="80" HorizontalAlignment="Right">Potrdi</Button> <CheckBox Name="ChbCreateOnlyZip" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10 0">Pripravi samo zip</CheckBox>
<CheckBox Name="ChbPublishToAll" HorizontalAlignment="Left" VerticalAlignment="Center">Publish vsem (vsi brez licence dobijo verzijo)</CheckBox>
</StackPanel>
<Button Grid.Column="2" Name="BtnPublish" Width="80" HorizontalAlignment="Right">Potrdi</Button>
</Grid> </Grid>
</Grid> </Grid>
</Window> </Window>

View File

@@ -244,7 +244,8 @@ namespace InfosysPublisher
.GetElementsByTagName("variable") .GetElementsByTagName("variable")
.Cast<XmlNode>() .Cast<XmlNode>()
.FirstOrDefault(x => x.Attributes != null .FirstOrDefault(x => x.Attributes != null
&& x.Attributes.Cast<XmlAttribute>().Any(y => y.Name == "name" && y.Value == "AplikacijaGuid")); && x.Attributes.Cast<XmlAttribute>().Any(y => y.Name == "name"
&& y.Value is "AplikacijaGuid" or "GuidApplication"));
if (node != null) if (node != null)
tmpSelectedProjectGuid = node.Attributes["value"].Value; tmpSelectedProjectGuid = node.Attributes["value"].Value;
@@ -361,6 +362,8 @@ namespace InfosysPublisher
return; return;
} }
var publishToAll = ChbPublishToAll.IsChecked ?? false;
//InfosysUpdate //InfosysUpdate
//v&H6c$wTbTkgSgdWvL*8k$st3#z5X //v&H6c$wTbTkgSgdWvL*8k$st3#z5X
var error = ""; var error = "";
@@ -417,7 +420,7 @@ namespace InfosysPublisher
File.Delete(tmpXmlFile); File.Delete(tmpXmlFile);
} }
if (xmlVersion != "") if (publishToAll && xmlVersion != "")
{ {
var projectArchive = sftpServer.SftpArchivePath + "/" + _selectedProjectPublishLocation; var projectArchive = sftpServer.SftpArchivePath + "/" + _selectedProjectPublishLocation;
if (!sftpClient.Exists(projectArchive)) if (!sftpClient.Exists(projectArchive))
@@ -455,12 +458,16 @@ namespace InfosysPublisher
var genPublishLocation = _selectedProjectPublishLocation + "/" + "Package.zip"; var genPublishLocation = _selectedProjectPublishLocation + "/" + "Package.zip";
var genPublishLocationTmp = _selectedProjectPublishLocation + "/" + "Package_tmp.zip"; var genPublishLocationTmp = _selectedProjectPublishLocation + "/" + "Package_tmp.zip";
using (var fileStream = new FileStream(zipPath, FileMode.Open)) if (publishToAll)
{ {
sftpClient.UploadFile(fileStream, genPublishLocationTmp, using (var fileStream = new FileStream(zipPath, FileMode.Open))
true); {
sftpClient.UploadFile(fileStream, genPublishLocationTmp,
true);
}
} }
var sftpDirVersion = _selectedProjectPublishLocation + "/" + _selectedProjectVersion; var sftpDirVersion = _selectedProjectPublishLocation + "/" + _selectedProjectVersion;
if (!sftpClient.Exists(sftpDirVersion)) if (!sftpClient.Exists(sftpDirVersion))
@@ -475,18 +482,21 @@ namespace InfosysPublisher
true); true);
} }
if (sftpClient.Exists(genPublishLocation)) if (publishToAll && sftpClient.Exists(genPublishLocation))
sftpClient.DeleteFile(genPublishLocation); sftpClient.DeleteFile(genPublishLocation);
if (sftpClient.Exists(versionPublishLocation)) if (sftpClient.Exists(versionPublishLocation))
sftpClient.DeleteFile(versionPublishLocation); sftpClient.DeleteFile(versionPublishLocation);
sftpClient.RenameFile(genPublishLocationTmp, genPublishLocation); if (publishToAll)
sftpClient.RenameFile(genPublishLocationTmp, genPublishLocation);
sftpClient.RenameFile(versionPublishLocationTmp, versionPublishLocation); sftpClient.RenameFile(versionPublishLocationTmp, versionPublishLocation);
//XML na koncu //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", sftpClient.UploadFile(fileStream, _selectedProjectPublishLocation + "/" + "Update.xml",
true); true);
} }