Wix Bootstrapper will not open wpf ui - bootstrapper

I have been attempting to write a WPF UI for the WiX installer that chains multiple msis from our company together.
I have followed This Link to do so, however, I cannot get the ui app tp open at all.
I have gotten the command line to run the MyBootstrapper.exe file and save the logs to the desktop.
[1CAC:1CB0][2020-08-06T08:31:55]i001: Burn v3.11.2.4516, Windows v10.0 (Build 18362: Service Pack 0),
path: C:\Users\james\AppData\Local\Temp\{75974D4E-F6FC-4A63-8B17-9C40D549A877}\.cr\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:55]i009: Command Line: '-burn.clean.room=C:\Users\james\Desktop\MyBootstrapper.exe -burn.filehandle.attached=632 -burn.filehandle.self=688 -l log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\james\Desktop\MyBootstrapper.exe'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\james\Desktop\'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\james\Desktop\log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleName' to value 'MyBootstrapper'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleManufacturer' to value 'James'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Loading managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create the managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to load UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed while running
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleAction = 5
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleElevated = 0
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleLog = C:\Users\james\Desktop\log.log
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleManufacturer = James
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleName = MyBootstrapper
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSource = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSourceFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleProviderKey = {3d87621d-9ee8-4412-843e-67b7d5da8dd5}
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessPath = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleTag =
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleUILevel = 4
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleVersion = 1.0.0.0
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to run per-user mode.
[1CAC:1CB0][2020-08-06T08:31:56]i007: Exit code: 0x80131508, restarting: No
What I don't understand is why this never attempts to open the WixBootstrapper.Run method. I know this because, the very first line I have a log message that says Engine.Log(LogLevel.Verbose, "Starting Custom UI");
so I would assume that this has to be in the Bundle.wxs file that looks like.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="MyBootstrapper" Version="1.0.0.0" Manufacturer="James" UpgradeCode="c59306b1-bc3d-4aa0-9936-53f2a3484343">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
<Payload SourceFile="$(var.InstallerUI.TargetDir)BootstrapperCore.config"/>
<Payload SourceFile="$(var.InstallerUI.TargetDir)InstallerUI.dll"/>
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="Netfx45Full"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="NetFxLicense.rtf"/>
<Chain>
<MsiPackage Id="WPFInstaller" SourceFile="$(var.Installer.TargetPath)" />
</Chain>
</Bundle>
</Wix>
On to my question, Can someone please explain what I am doing wrong, and why this doesn't open bootstrapper class in cs?
Also, I have extracted the MyBootstrapper.exe file and all of my dependencies are in it.

I was able to get past this point where it is now attempting to install the application, it still doesn't open the WPF UI, but it does now at least attempt it.
I had to change the BootstrapperCore.config From
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
To
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.5" />
</startup>

Related

Wazuh syscheck agent SQL error on centos7: FIM is not working

I havd wazuh v3.13.3 installed on centos 7.
syscheck module configuration:
<syscheck>
<disabled>no</disabled>
<!-- Frequency that syscheck is executed default every 12 hours -->
<frequency>43200</frequency>
<scan_on_start>yes</scan_on_start>
<alert_new_files>yes</alert_new_files>
<!-- Directories to check (perform all possible verifications) -->
<directories check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
<directories check_all="yes">/bin,/sbin,/boot</directories>
<directories check_all="yes" realtime="yes">/root</directories>
<!-- Files/directories to ignore -->
<ignore>/etc/mtab</ignore>
<ignore>/etc/hosts.deny</ignore>
<ignore>/etc/mail/statistics</ignore>
<ignore>/etc/random-seed</ignore>
<ignore>/etc/random.seed</ignore>
<ignore>/etc/adjtime</ignore>
<ignore>/etc/httpd/logs</ignore>
<ignore>/etc/utmpx</ignore>
<ignore>/etc/wtmpx</ignore>
<ignore>/etc/cups/certs</ignore>
<ignore>/etc/dumpdates</ignore>
<ignore>/etc/svc/volatile</ignore>
<ignore>/sys/kernel/security</ignore>
<ignore>/sys/kernel/debug</ignore>
<ignore>/dev/core</ignore>
<!-- File types to ignore -->
<ignore type="sregex">^/proc</ignore>
<ignore type="sregex">.log$|.swp$</ignore>
<!-- Check the file, but never compute the diff -->
<nodiff>/etc/ssl/private.key</nodiff>
<skip_nfs>yes</skip_nfs>
</syscheck>
Adding new file to the /root directory:
[root#host ossec]# date; echo "date" > ~/newfile.txt
Sat May 7 17:01:48 UTC 2022
agent log messages:
2022/05/07 17:01:48 ossec-syscheckd[26052] fim_db.c:558 at fim_db_exec_simple_wquery(): ERROR: SQL ERROR: cannot commit - no transaction is active
2022/05/07 17:01:48 ossec-syscheckd[26052] fim_db.c:558 at fim_db_exec_simple_wquery(): ERROR: SQL ERROR: cannot commit - no transaction is active
2022/05/07 17:01:48 ossec-syscheckd[26052] fim_db.c:558 at fim_db_exec_simple_wquery(): ERROR: SQL ERROR: cannot commit - no transaction is active
2022/05/07 17:01:48 ossec-syscheckd: ERROR: SQL ERROR: (8)attempt to write a readonly database
2022/05/07 17:01:48 ossec-syscheckd: ERROR: SQL ERROR: (8)attempt to write a readonly database
and I see no messages about new file in the logs.
It is too big infrastructure to upgrade to wazuh 4.x
How to solve this issue?
Thank you.
The message ERROR: SQL ERROR: (8)attempt to write a readonly database indicates some kind of problem with database permissions or that the FIM database fim.db does not exist, please check that the following files in the agent exist and have the following permissions, user, and group:
[drwxr-x--- ossec ossec ] /var/ossec/queue/fim
[drwxr-x--- ossec ossec ] /var/ossec/queue/fim/db
[-rw-rw---- root ossec ] /var/ossec/queue/fim/db/fim.db
[-rw-rw---- root ossec ] /var/ossec/queue/fim/db/fim.db-journal
In case the fim.db file does not exist, the agent recreates said file when restarting the agent.
In case the fim/ or fim/db/ directories do not exist, it is necessary to create them using the mkdir command and assign them the properties specified above [drwxr-x--- ossec ossec], then restart the agent.

WSO2 IS Unable to compile class for JSP

I'm using WSO2 IS 5.10 with docker and after making a change to the image, which has nothing to do with JSPs, opening the dashboard on the service provider list I see a white screen.
In wso2 log I found errors like this:
Servlet.service() for servlet [bridgeservlet] threw exception org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [17] in the generated java file: [/home/wso2carbon/wso2is-5.10.0/lib/tomcat/work/Catalina/localhost/ROOT/proxytemp/hc_1893914628/org/apache/jsp/application/list_002dservice_002dproviders_jsp.java]
Only a type can be imported. org.wso2.carbon.identity.application.common.model.xsd.ApplicationBasicInfo resolves to a package
An error occurred at line: [118] in the jsp file: [/application/list-service-providers.jsp]
ApplicationBasicInfo cannot be resolved to a type
115: <%
116: String BUNDLE = "org.wso2.carbon.identity.application.mgt.ui.i18n.Resources";
117: ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE, request.getLocale());
118: ApplicationBasicInfo[] applications = null;
119:
120: String filterString = request.getParameter(ApplicationMgtUIConstants.SP_NAME_FILTER);
121: filterString = ApplicationMgtUIUtil.resolveFilterString(filterString);
this disappears when restarting the image.
I’d like to know what it’s due to

Need to remove white spaces and PS dir when running from ant using filterchain and replaceregex pattern

Here is a sample log file that I am trying to parse through
Added Change Sets
Component PS
9476: Build changes to make for Ant task [Nov 12, 2015 12:02 PM]
Work Item 9476: Build changes to make for Ant task
/PS/build/AntTaskHelper.xml
9582: Testing for EBF and migration script changes [Nov 12, 2015 12:02 PM]
Work Item 9582: Testing for EBF and migration script changes
/PS/database/ebf-migration/EBF-RTC-9582.sql
/PS/database/sif-internal-migration-scripts/RTC-9582.sql
9583: PKB PKG and Image File testing [Nov 12, 2015 12:02 PM]
Work Item 9583: PKB PKG and Image File testing
/PS/database/src/program-units/RTC-9583-PKG_CDT.pkb
/templates/Images/RTC-9583-ABAKER.TIF
/templates/Templates/RTC-9583-A100_1_20090101.xdp
Ultimately I need the results to show the following:
/database/ebf-migration/EBF-RTC-9582.sql
/database/sif-internal-migration-scripts/RTC-9582.sql
/database/src/program-units/RTC-9583-PKG_CDT.pkb
/templates/Images/RTC-9583-ABAKER.TIF
/templates/Templates/RTC-9583-A100_1_20090101.xdp
My regular expression works perfectly well when testing with a sample reg exp tester but not quite what I need when running in the build.
Here's my target
<target name="Parse">
<loadfile property="textFile" srcfile="${deployDir}\buildChanges1.txt">
<filterchain>
<linecontainsregexp>
<regexp pattern="((/database/(ebf-migration|sif-internal-migration-scripts/|src/program-units/))|(/templates/)).*" />
</linecontainsregexp>
<replaceregex pattern="((/database/(ebf-migration|sif-internal-migration-scripts/|src/program-units/))|(/templates/)).*" replace="\0"/>
</filterchain>
</loadfile>
<echo message= "value based on regex =${textFile}"/>
</target>
Here's the output from the build.
Parse:
[echo] value based on regex = /PS/database/ebf-migration/EBF-RTC-9582.sql
[echo] /PS/database/sif-internal-migration-scripts/RTC-9582.sql
[echo] /PS/database/src/program-units/RTC-9583-PKG_CDT.pkb
[echo] /templates/Images/RTC-9583-ABAKER.TIF
[echo] /templates/Templates/RTC-9583-A100_1_20090101.xdp
Any help on getting this to run would be greatly appreciated.

RegexFilter with RollingFileAppender not working properly

I am trying to use Regexfilter in RollingFileAppender. For 1st matching instance it retreived the logger, but after that I different patttern but nothing is logged in the file. Here is what I am using:
Main Class:
public class MainApp {
public static void main(String[] args) {
final Logger logger = LogManager.getLogger(MainApp.class.getName());
ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
HelloWorld obj = (HelloWorld) context.getBean("helloWorld");
logger.trace("NPF:Trace:Entering Log4j2 Example.");
logger.debug("NTL:debug Entering Log4j2 Example.");
obj.getMessage();
Company comp = new Company();
comp.setCompName("ANC");
comp.setEstablish(1889);
CompanyBusiness compBus = (CompanyBusiness)context.getBean("compBus");
compBus.finaceBusiness(comp.getCompName(), comp.getEstablish());
logger.trace("NTL: Trace: Exiting Log4j2 Example.");
}
}
log4j2.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd [%t] HH:mm:ss} %-5p %c{1}:%L - %m%X%n" />
</Console>
<RollingFile name="RollingFile" fileName="C:\logTest\runtime\tla\els3.log" append="true" filePattern="C:\logTest\runtime\tla\els3-%d{yyyy-MM-dd}-%i.log" >
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %m%X%n" />
<RegexFilter regex=".*business*." onMatch="ACCEPT" onMismatch="DENY"/>
<Policies>
<SizeBasedTriggeringPolicy size="20 MB" />
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Logger name="com.anc" level="trace"/>
<Root level="trace">
<AppenderRef ref="STDOUT" />
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
When I ran for the first time, in my logfile I got logs having only "business" related line. Latter I changed the patter from .business (pattern has astreik before and after business word). to "business", logging did not happen in file nor on the console. Also my application terminated without any kind of logging.
Then I tried to revert back the pattern to '.business.' (pattern has astreik before and after business word), thereafter no logging happened on the log file, but on the console all the log trace is printed. When I comment out the Regexfilter after trying for long time, my logs was printed in the log file.
I am not sure if this is a bug of Regexfilter works only for one time. Also if we do not pass any patter matching characters, the application stops without any log printing either on console or file.
If you want to log all events containing the word "business", then you shall use the regex .*business.* instead of .*business*.. Here is an example:
<RegexFilter regex=".*business.*" onMatch="ACCEPT" onMismatch="DENY"/>
For information, .*business*. means: anything, followed by business, followed by s character 0 or more time, followed by any single character.
More explaining:
. means any single character
* means 0 or more times
so .* means any character, 0 or more times.

I cannot put file with cfftp, any ideas why?

I am trying to create a function to upload two xml files to another website once a day, I can make a connection fine using this code
<cfftp action = "open"
username = "xxxx"
connection = "MyConnection"
password = "xxxx"
server = "xxx"
passive="yes"
secure="true">
but then when I try to put the file using this code
<cfftp
action="putFile"
connection="MyConnection"
localfile="xxx"
remotefile="xxx">
then I get this error
An error occurred during the sFTP putFile operation.
Error: Permission denied.
The error occurred in xxxxx: line 13
11 : connection="MyConnection"
12 : localfile="xxxx"
13 : remotefile="xxxx">
Additional background info is that I can upload via filezilla.
Just use passive="yes" with the putFile operation:
<cfftp
action="putFile"
connection="MyConnection"
localfile="xxx"
remotefile="xxx"
passive="yes">
I just had a look at some code I wrote a while ago that uses cfftp, and my remotefile contains the full path. Can you confirm if yours does this?
The error "permission denied" would make sense it if was trying to upload it into the wrong directory also. Let us know how you go.