WMIC cannot install file with wildcard in file name - wix

I am trying to use Jenkins to install a versioned msi on a target machine like this:
wmic /node:"[HOST]" /user:"[USER]" /password:"[PASS]" product call install true ,"", "\\[HOST]\D$\WebsitesDirectory\Product.*.msi"
The file name will contain the version number so I can't hard-code this into the wmic command. But wmic doesn't seem to be able to install a file using a wildcard and quietly fails to install when I run this command. It appears that it has to have the exact path and filename of the file to install it. Does anyone know a way of using wildcards within file names or perhaps a better workaround?
Another possibility is this - Is it possible to get the exact name of the file that Jenkins pulled in via the copy artifact plugin?

So apparently this is not a wmic issue but a windows cmd one. I found that this solves the problem:
for %%f in (*.msi) do (
wmic /node:"[host]" /user:"[user]" /password:"[pass]" product call install true, "", "\\[host]\D$\WebsitesDirectory\%%f"
)

Related

How do I specify JRE when creating a Bamboo sidekick agent for their per-build-container plug-in?

Trying to get the sidekick image built and having some issues. Is there any documentation other than the README.md file?
My current problem is with getting the JRE requirement working but there are others. The page says "download Oracle JRE and place it inside the working directory. Optionally if you have a company wide distribution url, use that one at a later step." and the help says "Java (JRE) download url or path inside working directory". Have not been able to get this to work.
I went to the JRE link provided and was presented with options to download a rpm file or a tar.gz file. Which is expected (was unable to get either one working)?
It says to place the file in the "working directory" but not sure where exactly. Tried in sidekick folder and in sidekick/jre both without success no matter what I used after the -j command. Is this just the path or should the filename be included as well? Can I get an example?
I'm running this script using my login but noticed the output folder is being created with root user and group. I see no indication that this should be run with sudo. What is the correct way to run this script?
Using debug, I see the function "download if not cached". Can I save these files (JRE, Bamboo jar file, etc.) somewhere so I don't have to worry about downloading them? If so, where should they go? Looks like I might have a problem with the wget to d/l the jar file so would like to just be able to place all these in a folder and be done with it.
It looks like the major problem is the script didn't clean up after itself if it fails. The issue was the first time it failed then that caused subsequent issues as the output folder was already there. Removing this directory between each attempt help.
As for the correct syntax for the -j JRE option I manually downloaded the JRE and placed in a folder called per-build-container/sidekick/stuff/. For the command line it is not just the path but the file name as well (the tar.gz and not the RPM). For my case it was
-j stuff/jre-8u251-linux-x64.tar.gz
Note I also ran the script as sudo. Wasn't stated but seemed to work OK.
Another issue I ran into was the download of the agent jar file. There is a redirect in the wget file that was not working for us. I ended up editing the script and replacing the Altassian based url with the redirected one.
This addresses all the issues I ran into with the initial question.

Express Gateway

I'm new to node js, I having a issue with express-gateway
I have installed node(V 10.0.0), express(V 4.16.3) & express-gateway.
I'm getting an error:
D:\User\Test\Express-Gateway>eg -version
'eg' is not recognized as an internal or external command,
operable program or batch file.
as I fire cmd: eg -version or eg express-gateway create
Thanks in advance.
In case of a valid installation, you can find a corresponding windows command script (named eg) residing in your node installation folder (e.g.: C:\Program Files\nodejs\eg).
Next the windows environment variable PATH has to contain the above mentioned path (in order to check this just run PATH in cmd shell => this will print out the value of PATH, which is a list of file paths seperated by semi colons). If the node.js entry is missing, you can add the path by updating the variable manually.

CLI tools when using bash on windows with subsystem for Linux

I have installed NPM for Windows, Git for Windows and bunch for global NPM packages that I can use from command line.
When I use bash shell from Windows Subsystem for Linux, do I have to install all the tools again in the Linux subsystem?
No!
But you will need to set up your WSL environment to conveniently access Windows programs.
See below, How
In your WSL .profile, set PATH to include the directories where your Windows programs are installed
set WHOME to your Windows home directory where many files go by default.
Note, append ".exe" to command name. Some Windows commands will accept "-option" style arguments, but you might have to use "/option".
Finally,
You can use "wslpath" command to convert between Windows file names using "C:" and WSL file names using "/mnt/c".
Cygwin does not require appending ".exe" to command names. Cygwin uses the environment variable:
declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
I assume the system exec() function was modified to search suffixes.

how to use CAM::PDF to find + replace from command line

Sorry for the noob question. I just downloaded CAM::PDF along with Strawberry for Windows, and trying to do find/replace from the command line. Ran buidinstalldeps to get all needed prereqs.
I'm trying to run changepagestring.pl from command line. But idk how to reference the file location and have it put the output file for me in a specified location:
changepagestring.pl master-exch-manual.pdf "as shown in Figure" figure output.pdf
My goal is to replace "see above figure" with "figure" in this file. But it's in a different directory than the one I'm in, C:\Users\Me\Doc\CAM-PDF-1.60\
So how do I run and do all this from the command line. I've seen the help file with example, but I get this:
CAM::PDF from command shell with PL file not recognized
There are a few possible solutions. The easiest one from the directory you mentioned is:
perl -Ilib bin/changepagestring.pl ...
Alternatively, if you run the usual Perl install commands from that folder, then changepagestring.pl should be included in your usual path
perl Makefile.PL
make install
Alternatively^2, you can use the "cpan" tool to automate the download, build, test and install steps in one go:
cpan install CAM::PDF

How to use gitbash instead of windows cmd.exe with meteor Release 0.7.0.1-win2

I am getting started with Meteorjs. I'm a windows user so I downloaded the windows installer package Release 0.7.0.1-win2. I use gitbash for my command line interface and can't get it to recognize meteor. I get the error "sh.exe": meteor: command not found". It works fine in windows command line but I prefer gitbash.
How do I get meteor to work with gitbash?
I have the perfect answer for you since I literally just solved the issue myself.
First of all make sure meteor works in the default windows command prompt. Next open git bash and check if the following command works:
cmd //c meteor
This runs the command meteor as if you were in the command prompt.
Next step is to set up an alias in git bash so you don't have to type that out each time.
Open git bash and enter the following:
vim ~/.bashrc
this will open/create the bashrc file in VIM, press i to insert and type the following:
alias meteor="cmd //c meteor"
Save and exit vim by first pressing the Esc key then press the ":" key. Now you should be able to enter commands in VIM. Type "wq" and press enter which will write into your .bashrc file and exit vim.
Almost there! Now that you are back in git bash, all you need to do is point to your .bashrc file by entering the following:
source ~/.bashrc
Now you will be able to run meteor commands straight from git bash! Hope that helped!
Here's the fix:
The problem is because of .bat files not being handled properly by
MinGW
Go to this directory - C:\Users[your username]\AppData\Local\.meteor
You should see a meteor.bat file there. Create a new file called "meteor" (without any extension and ""). Open it with notepad and paste the following:
#!/bin/sh
cmd //c "$0.bat" "$#"
save the file and now run git bash. You should be able to use meteor command in git bash.
Details
To run a *.bat command from MinGW's MSYS shell, you must redirect the execution to cmd.exe, thus:
cmd //c foo.bat [args ...]
The foo.bat command file must be in a directory within $PATH, (or you must specify the full path name ... using slashes, not backslashes unless you use two of them for each path name separator). Also, note the double slash to inform cmd.exe that you are using its /C option, (since it doesn't accept the -c form preferred by the MSYS shell.
If you'd like to make the foo.bat file directly executable from the MSYS shell, you may create a two line Bourne shell wrapper script called simply foo alongside it, (in the same directory as foo.bat), thus:
#!/bin/sh
cmd //c "$0.bat" "$#"
(so in your case, you'd create script file meteor alongside meteor.bat).
In fact, since this wrapper script is entirely generic, provided your file system supports hard file links, (as NTFS does for files on one single disk partition), you may create one wrapper script, and link it to as many command file names as you have *.bat files you'd like to invoke in this manner; (hint: use the MSYS ln command to link the files).
Credits to: Keith Marshall on SO and rakibul on Meteor Forums
It shouldn't be too hard - you just need to make sure that the meteor.bat file is in your executable. Check with echo $PATH from the bash console if it is already there.
For me, the meteor 0.7.0.1-win installer appended meteor's folder to the path automatically. However, you can add it manually with:
export PATH=$PATH:/path/to/user/folder/AppData/Local/.meteor
(On CygWin my user folder is at /cygdrive/c/Users/adam - I'm not sure what the equivalent path would be on git bash).
If you like, append that line to your ~/.profile to make sure meteor gets added to the path when the console opens.
Finally, on Windows the executable file is meteor.bat. I made a symbolic link to the filename meteor, just so I wouldn't have to type the .bat:
cd /path/to/user/folder/AppData/Local/.meteor
ln -s meteor.bat meteor.
Please have a look at the issue https://github.com/sdarnell/meteor/issues/18
I would suggest maybe creating a trivial wrapper script or alias that invokes LaunchMeteor.exe with the original arguments.
After more research on google I see that there isn't an implemented way to do this yet. The guys at meteor are working on it and accepting pull requests if you have a solution. The conclusion I came to is to use Vagrant and virtualbox to set up a ubuntu vm for meteor development. You can find info at this site: http://win.meteor.com/ on how to install virtual machines and provision to work with meteor.