How to update my Windows application package in wingetcreate - cmd

I have a little problem while I want to update my package. I'll explain this: I published my package. After that, I waited for 2-3 hours for my packages be in the microsoft/winget-pkgs in GitHub. My branch merged successfully, It works on any Windows devices but, I created a new version of my application: v3.6.2. The version that I released it was v3.5.7. So now, I can't publish that version because this error is showing when I execute this cmd command: wingetcreate update <packageIdentifier> -u https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe --version 3.6.2 -t ghp_YourGithubPersonalAccessTokenWith_public_repo_setting.
If you want an image, i'll show you the image (My Windows is French btw): Here the image. But as you can see, the red is the error and I tried everything, I searched on Google and didn't find anything that fixed my problem, I tried the examples showed above when you only execute this command: wingetcreate.exe update but still the same error message that you can see on the image.
So I decided to take the third example but same, without success. Is there a way that could update my WinGet package? Thanks!
I don't know if this could help but I can give you some info: it's inno, the achitecture is Neutral.
IMPORTANT NOTE:
FIX HERE
The last answer works but if you type the command winget search <YourApp>, it will keep the previous version and if you install, it would install the previous one... How to fix that because it is litteraly NOT updating but doing nothing.

It's hard for me to know exactly what the issue is without knowing the contents of the manifest or the metadata of the installer. My gut feeling is that there is an architecture mismatch when trying to match the installer you provided with the existing installer that is currently specified in the existing manifest. To override the detected architecture you can use the '|' symbol followed by the desired architecture. Here is an example:
wingetcreate update <packageIdentifier> -u "https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe|x64" --version 3.6.2 -t <githubToken>
If that doesn't work for you, I would encourage you to post an issue on the GitHub repository so we can help you further.

Okay, I found the way: You take the code that the previous answer contains, and add -s:
wingetcreate update -s <packageIdentifier> -u "https://github.com/YourUsername/yourrepository/releases/download/3.6.2/yourapp.exe|x64" --version 3.6.2 -t <githubToken>
It will publish the application on GitHub for verification, in the command prompt you put (replace the sentence in the quotes with your current manifest file):
winget validate --manifest "PathToYourManifestShowedInGreenAfterPublishing"
When the validation on GitHub is done, it's done and normally it should work.
NOTE: Verification on GitHub can take 2 to 3 hours or even 4 hours. Be patient! (I hope)

Related

How to solve "The procedure entry point GetHostNameW could not be located in the dynamic link library WS2_32.dil" when command "heroku create"

I get "The procedure entry point GetHostNameW could not be located in the dynamic link library WS2_32.dil" error when I command Heroku create . I already installed Heroku cli on my computer. For the first time (first project) it (Heroku create) worked fine.
But the 2nd time when I gave this command it gave me an error.
After a long research on the internet I could not get rid of this error.
Now please tell me how I can solve this problem ? Note: My OS is Windows 7
You cannot. GetHostNameW is only available in Windows 8 and above.
see: https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-gethostnamew
PROBLEMO
Heroku CLI current latest version (as of July 2022) is 7.60.2, which was forced by auto-update onto our machine regardless of our OS version; this CLI version somehow used WS2_32.dll with GetHostNameW API that only applicable to Windows 8+. Error:
Node.exe - The procedure entry point GetHostNameW could not be located in the dynamic link library WS2_32.dll
No Heroku problem-ticket was open as far as I know (and Heroku PROHIBITS me from opening a new ticket!)
SOLUTION
This is a "hack" (temporary) solution until - hopefully - Heroku addresses this issue! Basically we will force our local machine Heroku CLI to use the previous version that was working before the latest update.
Open: [YourLocalUserFolder]\AppData\Local\heroku\autoupdate.log => Go to the last update log (typically the LAST line at the bottom of the file), and see which version that was working before the latest updates who broke it. Example:
waiting until 2022-07-23T22:40:33.199Z to update
time to update
heroku: Updating CLI...
heroku: Updating CLI from 7.59.2 to 7.60.2... done
From this log, we found that the currently used CLI is v. 7.60.2. This version is the one broke my CLI on Windows 7, causing the error. The solution here is to go back and use the previously working version: 7.59.2
Go to and make backup of the following:
Folder [YourLocalUserFolder]\AppData\Local\heroku\client\7.59.2 => As: [YourLocalUserFolder]\AppData\Local\heroku\client\7.59.2_BACKUP_20220723. Why? This is the WORKING CLI version, so we want to preserve it from Heroku auto-delete!
(Optional) File [YourLocalUserFolder]\AppData\Local\heroku\client\bin\heroku.cmd => As: [YourLocalUserFolder]\AppData\Local\heroku\client\bin\heroku.cmd_ORIG_20220723. Why? This is the original CMD file containing the latest syntax after Heroku latest update. We are going to modify this file.
Modify file: [YourLocalUserFolder]\AppData\Local\heroku\client\bin\heroku.cmd => with the following:
"%~dp0..\7.59.2\bin\heroku.cmd" %*
What it is: To modify the last line only, change from whatever latest version to "7.59.2" version. By doing this, when we run heroku CLI again, it shall use this version, and not the latest one.

Why can't SnowSQL 1.2.2 find a version to download?

First thing I do after unpacking the SnowSQL Linux client is try to upgrade it. This has worked very well through at least v1.1.84. Today I downloaded v1.2.2, installed it, and got an error:
$ ~/bin/snowsql -Uv
No snowsql is available for download: url=https://sfc-repo.snowflakecomputing.com/snowsql, version=1.2
The error comes from this download. Has something changed? I get the same error even when I just try to use it with no options at all, or trying to connect by passing my account code and username.
The curl above was missing https and hence gave the wrong impression of 403 forbidden.
Some times due to a caching issue with the downloads it will not autoupgrade. There are two main components, one being bootstrap and the other one being the main snowsql component. The one you see the issue with is the main component (it is auto-downloaded when you run snowsql).
You can force new version download using snowsql -v 1.2.2 as an exmaple.
You can delete/move the .snowsql directory (~/.snowsql or ~/bin/.snowsql) to ensure a new main component version is downloaded by the new bootstrap.
You may also try using the newer versions for which the rpm is available at
https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/index.html
I noticed Snowflake has some weird firewall configs and similar errors can either happen consistently or intermittently.
The only option I'm aware of that can help if it happens consistently is to use --noup flag with your commands. This will not check for snowsql updates of course, but you can always manually download a newer version via your browser(with VPN is needed).

D3.js, trouble initiating shp2json - encoding-indexes error

I'm trying to follow the tutorial Mike Bostock did for Command Line Cartography (which is a great help). Right after installing shapefile and running the shp2json step [shp2json cb_2014_06_tract_500k.shp -o ca.json] I get this error message:
“error: Decoder not present. Did you forget to include encoding-indexes.js first?” an error message which originates from the text-encoding package from NPM.
In trying to diagnoise the problem, I figured I should manually install text-encoding as it's in the shp2json dependency list but, didn't appear to be loading. I also reinstalled node to downgrade from 7.3.0 to 6.9.2 and a number of other things (my hacking around looking for a solution for a few hours) but, am stuck. Is this just a matter of updating a package.json?
I’m using Windows7, the env variables is set I believe correctly to \Users\myAccount\AppData\Roaming\npm. I’ve installed all packages globally as well. Thanks for any insight.
I had the same problem when running the "#prepublish" script here. Then I noticed that Mike's shapefile repo has this information in the README:
# shp2json --encoding *encoding*
Specify the dBASE table file character encoding. Defaults to “windows-1252”.
So I experimented and changed that script to:
shp2json --encoding utf-8 cb_${YEAR}_${STATE}_tract_500k.shp
Note that in this line above my state and year variables had been defined higher in the script (I was using Texas[48], not California[06]).
Also, I was getting another error asking for d3-array. So I installed that, too.
Problem solved (at least in terms of processing the data and getting it to render in the browser). Others issues, like projection, remain. Obviously.

pkgbuild OSX, Enforce installation failure in case of downgrade

I'd made a package that include 2 components according to --component-plist file. on the plist file I've added the following flag to prevent downgrade :
BundleIsVersionChecked: Don't install bundle if newer version on disk? (bool)
when I perform downgrade scenario, I get the following message :
Sep 15 11:42:49 os-x-10 installd[284]: PackageKit: Skipping component \
"com.my.driverAE21E" (<current_version>) because the version \
<new_version> is already installed at <my_component>
This is expected, but unfortunately, the installation goes on, and the other component is being properly installed, and so does the preinstall and postintsall scripts - so I get a mixture of both versions.
Is there any way to enforce component version validation prior to any attempt to actually install them, and stop the installation process in case the validation wasn't pass.
UPDATE :
Another approach that can help me is to prevent the running of preinstall and postinstall scripts in case an attempt to downgrade is made.
I've seen reference to unanswered question about this issue here.
What you need to do is add version-check to your distribution.xml for product archive, and then perform whatever check you want in JavaScript code. This will allow you to prevent installation from starting as early as possible by returning false from the check function. Can't give you an example as I never did custom version check myself, but using my.target.receiptForIdentifier() and system.compareVersions() should get you going.
More info on the matter: https://developer.apple.com/reference/installerjs (follow "Distribution Definition XML Schema Reference" link there for distribution.xml description).

plutil: command not found

Ultimate Goal:
I'm trying to convert a binary plist file to an xml format so that I can put it in an array and grab values from it. What I'm finding via web search on this is that the command for Linux comes from libplist.
Problem: I ran "yum install libplist" and it told me libplist is already installed and latest version. I've read that if I enter the following command:
plutil -i /mypath/file.plist > /mypath/file.xml.plist
That this will help accomplish my ultimate goal. However, when I do this only a blank file called file.xml.plist is created. Further, with this command and any other command involving plutil, I get a "bash: plutil: command not found. . ." error. Is libplist seemingly not installed (even though it says it is) or why would I repeatedly get this error? Thanks for your help.
You can use yum to look for a package knowing the binary you want. For instance, if I want to install the package that provides plutil, I simply run this command:
$> yum provides plutil
Unfortunately, the result is No matches found... But you say you read that the libplist package provides this tool. Maybe it was renamed ? Let's use repoquery for this (if you don't have it, yum provides repoquery tells you that you need to install yum-utils).
$> repoquery --list libplist
/usr/bin/plistutil
/usr/lib/libplist++.so.3
/usr/lib/libplist++.so.3.0.0
/usr/lib/libplist.so.3
/usr/lib/libplist.so.3.0.0
/usr/share/doc/libplist
/usr/share/doc/libplist/AUTHORS
/usr/share/doc/libplist/COPYING.LESSER
/usr/share/doc/libplist/README
And what I see is that a program called plistutil was installed with this package !
I've never used plutil, so I can't tell you for sure plistutil is the program you want (but it probably is). What I wanted to do instead with this post is to show how you can use yum to install the packages you need !
I ran across this thread while Googling for the same thing myself. After looking at a few solutions for my own company (Screenplay) I decided to fork and iterate on a open-source, cross-platform, drop-in replacement for plutil:
https://github.com/screenplaydev/plutil
It's forked from Facebook's xcbuild (a tool developed by them to build xcode projects on Linux), but stripped down to just provide plist-editting functionality. That way you won't need to maintain separate code-paths for Mac and Linux environments.
Hope that's helpful!

Resources