Skip to content

Commit 616dcad

Browse files
committed
osd_4.3.5.1_to_main
1 parent 8829e66 commit 616dcad

File tree

8 files changed

+186
-82
lines changed

8 files changed

+186
-82
lines changed

opsi-misc/opsisetupdetector/changelog-osd.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,25 @@ todo:
143143
*
144144

145145
# Changelog opsi-setup-detector
146+
## [4.3.5.1-1] - 2025-04-16
147+
148+
### Fix
149+
- markdown typo in msix info
150+
151+
(Detlef Oertel <[email protected]>)
152+
153+
## [4.3.5.0-1] - 2025-03-21
154+
155+
### Fix
156+
- more logging in osdform:BtCreateProductClick for build or not build
157+
- change meta data according to
158+
'2024-OTW18-PRODUCT-METADATASTRUCTURE' VERSION 0.1.6: 13.11.2024
159+
- osdanalyzewin: get_inno_info: detect architecture from iss file or installdir
160+
- osdanalyzewin: get_QtInstaller_info assume architecture is x64
161+
162+
163+
(Detlef Oertel <[email protected]>)
164+
146165
## [4.3.4.2-1] - 2024-11-05
147166

148167
### Fix

opsi-misc/opsisetupdetector/info-osd.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleName</key>
1414
<string>opsisetupdetector</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>4.3.4.0</string>
16+
<string>4.3.5.1</string>
1717
<key>CFBundleIconFile</key>
1818
<string>opsisetupdetector.icns</string>
1919
<key>CFBundleVersion</key>

opsi-misc/opsisetupdetector/opsisetupdetector.lpi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<UseVersionInfo Value="True"/>
3131
<MajorVersionNr Value="4"/>
3232
<MinorVersionNr Value="3"/>
33-
<RevisionNr Value="4"/>
34-
<BuildNr Value="2"/>
33+
<RevisionNr Value="5"/>
34+
<BuildNr Value="1"/>
3535
<StringTable CompanyName="uib gmbh (uib.de / opsi.org)" FileDescription="opsi setup detector" InternalName="opsi setup detector" LegalCopyright="AGPLv3" LegalTrademarks="opsi, opsi.org, open system integration" OriginalFilename="opsisetupdetector" ProductName="opsi" ProductVersion="opsi 4.3"/>
3636
</VersionInfo>
3737
<BuildModes Count="6">

opsi-misc/opsisetupdetector/osdanalyzewin.pas

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface
2121
strutils,
2222
SysUtils,
2323
fileinfo,
24+
typinfo,
2425
winpeimagereader,
2526
oslog,
2627
osdbasedata,
@@ -604,6 +605,10 @@ procedure get_inno_info(myfilename: string; var mysetup: TSetupFile);
604605
destfile := ExtractFileName(myfilename);
605606
destfile := ExtractFileName(destfile);
606607
installScriptISS := destDir + DirectorySeparator + 'install_script.iss';
608+
// innounp works only until inno version 6.1 (Supports Inno Setup versions 2.0.7 through 6.1.2)
609+
// inno version > 6.2 needs innounp-2
610+
// https://www.rathlev-home.de/index-e.html?tools/prog-e.html#unpack
611+
// https://www.rathlev-home.de/tools/download/innounp-2.zip
607612

608613
LogDatei.log('extract install_script.iss from ' + myfilename + ' to', LLInfo);
609614
LogDatei.log(installScriptISS, LLInfo);
@@ -705,11 +710,18 @@ procedure get_inno_info(myfilename: string; var mysetup: TSetupFile);
705710
(0 = pos('x86', lowercase(ArchitecturesInstallIn64BitMode))) then
706711
begin
707712
DefaultDirName := translateInnoConstants(DefaultDirName, '64');
713+
mysetup.architecture:= a64;
708714
end
709715
else
710716
begin
711717
DefaultDirName := translateInnoConstants(DefaultDirName, '32');
718+
mysetup.architecture:= a32;
712719
end;
720+
// guess architecture from installdir
721+
if DefaultDirName.StartsWith('%ProgramFiles64Dir%') then
722+
mysetup.architecture := a64
723+
else if DefaultDirName.StartsWith('%ProgramFiles32Dir%') then
724+
mysetup.architecture := a32;
713725
mysetup.installDirectory := DefaultDirName;
714726
if UninstallFilesDir <> '' then
715727
begin
@@ -732,6 +744,7 @@ procedure get_inno_info(myfilename: string; var mysetup: TSetupFile);
732744
begin
733745
LogDatei.log('installDirectory: ' + installDirectory, LLDebug);
734746
LogDatei.log('SoftwareVersion: ' + SoftwareVersion, LLDebug);
747+
LogDatei.log('Architecture: ' + GetEnumName(typeInfo(TArchitecture), Ord(architecture)), LLDebug);
735748
end;
736749
with aktProduct.productdata do
737750
begin
@@ -1085,13 +1098,14 @@ procedure get_QtInstaller_info(myfilename: string; var mysetup: TSetupFile);
10851098
begin
10861099
write_log_and_memo('Analyzing QtInstaller:');
10871100
mysetup.installDirectory := '%Programfiles64Dir%\"+$ProductId$+"';
1101+
mysetup.architecture:= a64;
10881102
write_log_and_memo('get_QtInstaller_info finished');
10891103
end;
10901104

10911105
procedure get_MsixAppx_info(myfilename: string; var mysetup: TSetupFile);
10921106
var
10931107
packagepath, cmdStr, versionStr, fullNameStr, displayNameStr: string;
1094-
destDir, proptmpstr: string;
1108+
destDir, proptmpstr, architectureStr: string;
10951109
xmlLines, nodeLines: TStringList;
10961110
manifesFileName : string;
10971111
i : integer;
@@ -1138,6 +1152,18 @@ procedure get_MsixAppx_info(myfilename: string; var mysetup: TSetupFile);
11381152
end
11391153
else
11401154
LogDatei.log('Could not get FullName from AppxManifest.xml.', LLwarning);
1155+
if getXml2AttributeValueByKey(nodeLines, 'ProcessorArchitecture', architectureStr) then
1156+
begin
1157+
if architectureStr = 'X86' then mysetup.architecture:= a32
1158+
else if architectureStr = 'X64' then mysetup.architecture:= a64
1159+
else if architectureStr = 'Neutral' then mysetup.architecture:= aUnknown
1160+
else mysetup.architecture:= aUnknown;
1161+
LogDatei.log('Got Architecture: ' + architectureStr +
1162+
' from node Identity in AppxManifest.xml', LLnotice);
1163+
LogDatei.log('Architecture: ' + GetEnumName(typeInfo(TArchitecture), Ord(mysetup.architecture)), LLDebug);
1164+
end
1165+
else
1166+
LogDatei.log('Could not get Architecture from AppxManifest.xml.', LLwarning);
11411167
end
11421168
else
11431169
LogDatei.log('Could not get node Identity from AppxManifest.xml.', LLwarning);

opsi-misc/opsisetupdetector/osdbasedata.pas

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ TOSDSettings = class(TPersistent)
108108
amSelectable);
109109

110110
// marker for add installers
111-
TKnownInstaller = (stWinget,stMsixAppx, stWise,
111+
TKnownInstaller = (stWinget, stMsixAppx, stWise,
112112
stQtInstaller,
113113
stSetupFactory,
114114
stInstallAnywhere,
@@ -203,8 +203,10 @@ TSetupFile = class(TPersistent)
203203
//Fwinbatch_del_argument: string;
204204
FinstallCommandLine: string; // command line to install the software
205205
FuninstallCommandLine: string; // command line to uninstall the software
206-
FinstallCommandStringEx: string; // String expression for prim section to install the software
207-
FuninstallCommandStringEx: string; // String expression for prim section to uninstall the software
206+
FinstallCommandStringEx: string;
207+
// String expression for prim section to install the software
208+
FuninstallCommandStringEx: string;
209+
// String expression for prim section to uninstall the software
208210
FuninstallProg: string; // path + name of the uninstall.prog
209211
FuninstallDirectory: string; // dir of the uninstall.prog
210212
FtargetProg: string;
@@ -277,17 +279,18 @@ TSetupFile = class(TPersistent)
277279
read FisExitcodeFatalFunction write FisExitcodeFatalFunction;
278280
property uninstallCommandLine: string read FuninstallCommandLine
279281
write FuninstallCommandLine;
280-
property installCommandStringEx: string read FinstallCommandStringEx
281-
write FinstallCommandStringEx;
282-
property uninstallCommandStringEx: string read FuninstallCommandStringEx
283-
write FuninstallCommandStringEx;
282+
property installCommandStringEx: string
283+
read FinstallCommandStringEx write FinstallCommandStringEx;
284+
property uninstallCommandStringEx: string
285+
read FuninstallCommandStringEx write FuninstallCommandStringEx;
284286

285287
property uninstallProg: string read FuninstallProg write SetUninstallProg;
286288
property uninstallDirectory: string read FuninstallDirectory
287289
write SetUninstallDirectory;
288290
property targetProg: string read FtargetProg write SetTargetProg;
289291
property uninstallCheck: TStrings read FuninstallCheck write SetUninstallCheck;
290-
property optionalUninstallLines: TStrings read FoptionalUninstallLines write SetOptionalUninstallLines;
292+
property optionalUninstallLines: TStrings
293+
read FoptionalUninstallLines write SetOptionalUninstallLines;
291294
property uninstall_waitforprocess: string
292295
read Funinstall_waitforprocess write Funinstall_waitforprocess;
293296
property install_waitforprocess: string
@@ -553,7 +556,7 @@ TConfiguration = class(TPersistent)
553556
Fdependencies_for_all_actionrequests: boolean;
554557
// since opsi 4.3 dependecies are allowed for all action requests
555558
FpreferMsiUninstall: boolean; // true=prefer uninstall via msi if possible
556-
FwriteMetaDataFile : boolean; // true=write opsi-meta-data.toml file
559+
FwriteMetaDataFile: boolean; // true=write opsi-meta-data.toml file
557560
procedure SetLibraryLines(const AValue: TStrings);
558561
procedure SetPreInstallLines(const AValue: TStrings);
559562
procedure SetPostInstallLines(const AValue: TStrings);
@@ -817,21 +820,24 @@ procedure reload_installer_info_messages;
817820
LineEnding + 'You may use this msi as install file.' + LineEnding +
818821
'You may perhaps also pass the msi parameters as arguments to your setup.exe.';
819822
mdInstallerInfo_MsixAppx =
820-
'## This is a Msix / Appx / AppxBundle / MsixBundle file.' + LineEnding +
821-
'This kind of packages may be installed via powershell.' + LineEnding +
822-
LineEnding + 'In order to check for the dependecies of this package' + LineEnding +
823-
'and if this package is aviable from MS store,' + LineEnding +
824-
LineEnding + 'then you may use the following web site to check and download' + LineEnding +
825-
LineEnding + 'missing packages: ' + LineEnding +
823+
'## This is a Msix / Appx / AppxBundle / MsixBundle file.' +
824+
LineEnding + 'This kind of packages may be installed via powershell.' +
825+
LineEnding + LineEnding + 'In order to check for the dependecies of this package' +
826+
LineEnding + 'and if this package is aviable from MS store,' +
827+
LineEnding + LineEnding +
828+
'then you may use the following web site to check and download' +
829+
LineEnding + LineEnding + 'missing packages: ' + LineEnding +
826830
LineEnding + '<https://store.rg-adguard.net/>' + LineEnding +
827-
LineEnding + 'There also is often a problem with the uninstallation.' + LineEnding +
828-
LineEnding + 'So the use of the "uninstall_before_install" checkbox is recommended.';
831+
LineEnding + 'There also is often a problem with the uninstallation.' +
832+
LineEnding + LineEnding +
833+
'So the use of the "uninstall\_before\_install" checkbox is recommended.';
829834
mdInstallerInfo_winget =
830835
'## Making a winget based package.' + LineEnding + LineEnding +
831-
'You need to know the winget Id and Source of the software to install.' + LineEnding +
832-
LineEnding + 'A tool that may help you to find this data is:' + LineEnding + LineEnding +
833-
'UniGetUI (formerly WingetUI), The Graphical Interface for your package managers' + LineEnding + LineEnding +
834-
'<https://www.marticliment.com/unigetui/>' ;
836+
'You need to know the winget Id and Source of the software to install.' +
837+
LineEnding + LineEnding + 'A tool that may help you to find this data is:' +
838+
LineEnding + LineEnding +
839+
'UniGetUI (formerly WingetUI), The Graphical Interface for your package managers' +
840+
LineEnding + LineEnding + '<https://www.marticliment.com/unigetui/>';
835841
// marker for add installers
836842

837843
implementation
@@ -1588,17 +1594,27 @@ procedure TopsiProduct.readProjectFile(filename: string);
15881594
if jsonIsValid(JSONString) then
15891595
begin
15901596
jsonAsObjectGetValueByKey(JSONString, 'Items', JSONString);
1597+
if Assigned(logdatei) then
1598+
logdatei.log('Import property JSONString: ' + JSONString, LLDebug);
15911599
if jsonIsArray(JSONString) then
15921600
begin
1593-
aktproperty := TPProperty.Create;
1601+
aktProduct.properties.Clear;
1602+
//if Assigned(logdatei) then
1603+
//logdatei.log('count: ' + inttostr(jsonAsArrayCountElements(JSONString) - 1), LLDebug);
1604+
// if jsonAsArrayCountElements(JSONString) > 0 then
15941605
for i := 0 to jsonAsArrayCountElements(JSONString) - 1 do
15951606
begin
1607+
aktproperty := TPProperty.Create;
15961608
jsonAsArrayGetElementByIndex(JSONString, i, JSONObjString);
1609+
// if Assigned(logdatei) then
1610+
// logdatei.log('JSONObjString: ' + JSONObjString, LLDebug);
15971611
aktproperty := aktProduct.properties.Add;
1598-
DeStreamer.JSONToObject(JSONObjString, aktproperty);
1599-
1612+
//DeStreamer.JSONToObject(JSONObjString, aktproperty);
1613+
DeStreamer.JSONToObject(JSONObjString, aktProduct.properties.Items[i]);
1614+
if Assigned(logdatei) then
1615+
logdatei.log('Property_Name: ' +
1616+
aktProduct.properties.Items[i].Property_Name, LLDebug);
16001617
end;
1601-
if Assigned(aktproperty) then FreeAndNil(aktproperty);
16021618
end;
16031619
end;
16041620
deactivateImportMode;

opsi-misc/opsisetupdetector/osdform.lfm

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object resultForm1: TresultForm1
2-
Left = 376
2+
Left = 112
33
Height = 674
4-
Top = 179
4+
Top = 393
55
Width = 1278
66
Caption = 'opsi Setup Detector'
77
ClientHeight = 674
@@ -166,12 +166,12 @@ object resultForm1: TresultForm1
166166
Height = 611
167167
Top = 0
168168
Width = 1046
169-
ActivePage = TabSheetSetup1
169+
ActivePage = TabSheetStart
170170
Align = alClient
171171
Images = ImageList1
172172
ParentFont = False
173173
ShowTabs = False
174-
TabIndex = 2
174+
TabIndex = 0
175175
TabOrder = 0
176176
OnChange = PageControl1Change
177177
object TabSheetStart: TTabSheet
@@ -13248,10 +13248,10 @@ object resultForm1: TresultForm1
1324813248
TIOptions = [tgoStartIndexAtOne, tgoShowOnlyProperties]
1324913249
ColWidths = (
1325013250
64
13251-
125
13252-
125
13253-
124
13254-
124
13251+
129
13252+
129
13253+
129
13254+
128
1325513255
)
1325613256
end
1325713257
object PanelDepBtns: TPanel
@@ -13674,10 +13674,10 @@ object resultForm1: TresultForm1
1367413674
TIOptions = [tgoStartIndexAtOne, tgoShowOnlyProperties]
1367513675
ColWidths = (
1367613676
64
13677-
238
13678-
238
13679-
238
13680-
237
13677+
242
13678+
242
13679+
242
13680+
242
1368113681
)
1368213682
end
1368313683
end

opsi-misc/opsisetupdetector/osdform.pas

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,9 +3093,18 @@ procedure TResultform1.BtCreateProductClick(Sender: TObject);
30933093
done := createProductStructure;
30943094
procmess;
30953095
case TIRadioGroupCreateMode.ItemIndex of
3096-
0: ; // do nothing else
3097-
1: callServiceOrPackageBuilder;
3098-
2: callOpsiPackageBuilder;
3096+
0: begin
3097+
logdatei.log('Create Mode is files only - so we finished', LLnotice);
3098+
end; // do nothing else
3099+
1: begin
3100+
logdatei.log('Create Mode is files and build - so we try to call the service', LLnotice);
3101+
callServiceOrPackageBuilder;
3102+
end;
3103+
2: begin
3104+
logdatei.log('Create Mode is files and interactive packageBuilder - so we try to call the opsiPackageBuilder', LLnotice);
3105+
callOpsiPackageBuilder;
3106+
3107+
end;
30993108
end;
31003109
(*
31013110
if RadioButtonCreateOnly.Checked then
@@ -3762,7 +3771,8 @@ procedure TResultform1.MenuItemAboutClick(Sender: TObject);
37623771
begin
37633772
list := TStringList.Create;
37643773
progname := ExtractFileName(ParamStr(0));
3765-
msg := progname + ' Version: ' + myVersion;
3774+
msg := progname + ' Version: ' + myVersion + ' ('+{$i %DATE%} + ', ' +{$i %TIME%}+')';
3775+
//msg := progname + ' Version: ' + myVersion;
37663776
list.Add(msg);
37673777
list.Add('(c) uib gmbh under AGPLv3');
37683778
list.Add('This is a part of the opsi.org project: https://opsi.org');

0 commit comments

Comments
 (0)