Hi Im new to install4j so forgive my misunderstandings, I have a x64 .exe that was built using INSTALL4J is there any way to get the java/jar out of it? does everything get compiled to PE64? This is the 7zip list of the .exe archive:
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2014-12-03 16:37:21 ..... 173056 173056 .text
2014-12-03 16:37:21 ..... 40960 40960 .rdata
2014-12-03 16:37:21 ..... 9216 9216 .data
2014-12-03 16:37:21 ..... 7680 7680 .pdata
..... 1612 1612 .rsrc\0\version.txt
..... 302 302 .rsrc\1033\DIALOG\101
..... 1188 1188 .rsrc\0\MANIFEST\1
2014-12-03 16:37:21 ..... 2048 2048 .reloc
2014-12-03 16:37:21 ..... 7384 7384 CERTIFICATE
2014-12-03 16:37:21 ..... 3072 3072 [0]
------------------- ----- ------------ ------------ ------------------------
2014-12-03 16:37:21 246518 246518 10 files
There is no PK value as per here
And another thing how do you debug such an .exe windbg can makes sense of it and a java debugger cannot see the process?
Launchers generated by install4j do not contain the JAR files, they use JNI to create the JVM and they include external JAR files into the classpath. You can run the launcher with the /create-i4j-log argument to see what it is doing.
Related
I want to zip a folder containing files, and subfolders containing more files and more subfolders. But I want exclude just one subfolder of a subfolder. I have seen many various complicated answers but none seem to really work on this scenario.
folder structure
temp/
a/
aa/
aaa/
aaaa/
filesinaaaa.txt
filesinaaa.txt
filesinaa.txt
at.txt
b/
bb/
bt.txt
c.txt
I want to exclude all files in a/aa/aaa/ while keeping the resulting zip in the same dir structure. And if possible remove the files that were included in the zip.
So result expected is
temp/
a/
aa/
aaa/
aaaa/
filesinaaaa.txt
filesinaaa.txt
result.zip
In linux it is as simple as
cd temp
zip -rm result.zip . -x "a/aa/aaa/*"
what is the simplest way to do this in powershell?
answers i've tried do not really work on subfolder of a subfolder.
Exclude sub-directories from Compress-Archive Powershell Cmd
How do I exclude a folder in compress-archive
over complicated result
Archive folder without some subfolders and files using PowerShell
You can use 7z CLI to do so, here is the doc explaining the usage of -x option in 7z
Showing an example of the option below for reference
The directory structure explained in the question:
C:\Users\adam_\Desktop\temp〉dir -R
a b c.txt
./a:
aa at.txt
./a/aa:
aaa filesinaa.txt
./a/aa/aaa:
aaaa filesinaaa.txt
./a/aa/aaa/aaaa:
filesinaaaa.txt
./b:
bb bt.txt
./b/bb:
Creating the archive:
PS C:\Users\adam_\Desktop\temp> 7z a -tzip result.zip . -x!a/aa/aaa/*
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive:
5 folders, 4 files, 63 bytes (1 KiB)
Creating archive: result.zip
Add new data to archive: 5 folders, 4 files, 63 bytes (1 KiB)
Files read from disk: 4
Archive size: 1217 bytes (2 KiB)
Everything is Ok
Result archive details:
PS C:\Users\adam_\Desktop\temp> 7z l .\result.zip
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive for archives:
1 file, 1217 bytes (2 KiB)
Listing archive: .\result.zip
--
Path = .\result.zip
Type = zip
Physical Size = 1217
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2022-05-05 09:48:37 D.... 0 0 a
2022-05-05 09:48:12 D.... 0 0 a\aa
2022-05-05 09:47:45 D.... 0 0 a\aa\aaa
2022-05-05 09:48:12 ....A 13 13 a\aa\filesinaa.txt
2022-05-05 09:48:37 ....A 13 13 a\at.txt
2022-05-05 09:49:20 D.... 0 0 b
2022-05-05 09:48:58 D.... 0 0 b\bb
2022-05-05 09:49:20 ....A 19 19 b\bt.txt
2022-05-05 09:49:56 ....A 18 18 c.txt
------------------- ----- ------------ ------------ ------------------------
2022-05-05 09:49:56 63 63 4 files, 5 folders
I'm using check_mk as monitoring solution and I disabled WMI service cause it create timeout when check_mk query for information.
Get-WmiObject / Get-Disk / Get-PSDrive use WMI service to get information and I would like to get disk information like total space, used space etc without using WMI beacause I can't.
Do you know any workaround do to that?
TL;DR -
(echo select disk=0 & echo list partition & (for /l %A in (1,1,10) do #echo select disk=next &#echo list partition)) | diskpart | findstr /i /v /r "^$ > microsoft ^reached ^select ^there ^the\ start"
Details -
The 'diskpart.exe' command can get you what you want. It requires admin rights, but since you mentioned disabling services, that didn't sound like an issue.
Rather than interacting with DISKPART's unique menu system, this example will blindly request the list of partitions on the first 11 disks (and filter away unnecessary lines..). Should be enough.
:-)
Cmd:
(echo select disk=0 & echo list partition & (for /l %A in (1,1,10) do #echo select disk=next &#echo list partition)) | diskpart | findstr /i /v /r "^$ > microsoft ^reached ^select ^there ^the\ start"
Output From My Live System:
Disk 0 is now the selected disk.
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 1863 GB 1024 KB
Disk 1 is now the selected disk.
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 350 MB 1024 KB
Partition 2 Primary 270 GB 351 MB
Partition 3 Recovery 845 MB 271 GB
Partition 4 Primary 204 GB 272 GB
Disk 2 is now the selected disk.
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 931 GB 1024 KB
I try to install vscode on windows7 and get "install failed error", no detailed information, is there someone get the same error? It is crazy that vscode can not be installed on windows.
Use something like 7Zip to extract the archived files to a VSCodeSetup folder, with the resulting files:
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 4/22/2015 8:28 AM 140782 background.gif
----- 4/27/2015 6:22 PM 60255967 Code-0.1.0-full.nupkg
----- 4/27/2015 6:22 PM 74 RELEASES
-a--- 4/30/2015 9:25 AM 1911 SquirrelSetup.log
----- 4/24/2015 11:12 AM 1492992 Update.exe
Then open PowerShell (a CMD window would also work). I cd'd into the VSCodeSetup folder and ran the following command:
PS>.\Update.exe --install=.
(You may need to run PS or the CMD window as Administrator)
Referenced post: VSCode Installation Failed - Failed to extract installer
I'm creating an eclipse plugin using java code generated via a Makefile (yes, I know ant). The final target of my makefile is a zip containing the following structure (I used the plugin for javacc as an inspiration):
$ unzip -l myplugin_2015.02.16.zip
Archive: myplugin_2015.02.16.zip
Length Date Time Name
--------- ---------- ----- ----
0 02-16-2015 09:30 feature/
0 02-16-2015 09:30 feature/myplugin.feature_2015.02.16/
474 02-16-2015 09:30 feature/myplugin.feature_2015.02.16/feature.xml
0 02-16-2015 09:30 plugins/
0 02-16-2015 09:30 plugins/myplugin_2015.02.16/
0 02-16-2015 09:30 plugins/myplugin_2015.02.16/META-INF/
527 02-16-2015 09:30 plugins/myplugin_2015.02.16/META-INF/MANIFEST.MF
492 02-16-2015 09:30 plugins/myplugin_2015.02.16/plugin.xml
23079 02-16-2015 09:30 plugins/myplugin_2015.02.16/idp192.jar
--------- -------
24572 9 files
No I'd like to import this zip in eclipse as a new plugin. When I run eclipse->install-new-software->Add->archive it fails with "no software size found for jar:... , do you wish do edit location ?".
I suspect I need to wrap this zip in a site file ? is there a minimal way to create this 'site' archive ? or is there a simplier solution , something missing in my plugin.zip ? Most important, I don't want to use any GUI.
Thank you for your help
fixed a few hours later: just moving my *.jar to eclipse/plugin fixed the problem.
I've hacked together a solution that allows me to commit changes to my Go language application to Azure Websites, compile into a Go binary, and then update the Web.Config to have the httpPlatformHandler use the newly created binary. This allows me to easily deploy changes to my Go app and have them (almost) instantly available on my Azure website. It's a neat prototype, and you can check it out here: https://github.com/wadewegner/azure-website-go-builder/
If you look at the last line of the deploy.cmd you'll see that I use Powershell to kill a w3wp.exe process. This forces it to restart and use the updated Web.Config.
powershell "stop-process (Get-Process w3wp | Sort-Object ws | Select -first 1).Id"
This is a hack and not ideal. In a default scenario there are two w3wp.exe processes running - one for our website and one for the SCM website (which is a management website). It will not work if we have more than one instance of our Azure website running. It also assumes that the right process to kill is the one with the smaller memory footprint - this is a bad assumption to make.
In Azure Websites we don't have a lot of facilities at our disposal for finding and killing processes.
When I run Get-Process w3wp ... I get this kind of output today:
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
364 40 7196 16032 85 0.55 5516 w3wp
667 77 61972 77372 350 5.72 3448 w3wp
However, with two instances of my website, it could be:
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
364 40 7196 16032 85 0.55 5516 w3wp
364 40 7196 16032 85 0.55 5517 w3wp
667 77 61972 77372 350 5.72 3448 w3wp
(Manually updated to make my point.)
So, the question is, what's the right way to choose the two processes I want to kill? I don't want to kill 3448.
Additionally, how do I find a better heuristic to choose the right processes?
I uploaded tlist.exe to run tlist -t and get this output:
D:\home\site\wwwroot>tlist -t
AdjustTokenPrivileges failed with 1300
w3wp.exe (5516)
20150107_070323.exe (4936)
w3wp.exe (3448)
cmd.exe (1976)
tlist.exe (5868)
This makes it clear that 5516 is the PID I want to kill.
Is there a way in Powershell to run Get-Process but if it somehow inspect child processes and filter out the w3wp.exe PID with the cmd.exe process?
Thank you!