#updater

277 messages Β· Page 1 of 1 (latest)

silver crystal
#

What do you need help with

blazing vector
mint storm
#

take a look why the download URL isn't set

#

e.g. do you get the correct response from the api?

blazing vector
mint storm
#

what redirects?

blazing vector
#
 // Construct direct download URL from tag_name
+    char downloadUrlBuffer[512];
+    sprintf_s(downloadUrlBuffer, 512, "https://github.com/%s/releases/download/%s/noteplus.exe", GITHUB_REPO, tagStart);
+    char *downloadUrl = _strdup(downloadUrlBuffer);```
mint storm
#

you mean this?

blazing vector
#

any clue?

#

idk actually

#

@mint storm

#

new code but didnt wor

shell dirgeBOT
#

@blazing vector has reached level 4. GG!

blazing vector
#

k

#
 // Update available - parse assets for download URL
+    char *assetsStart = strstr(response, "\"assets\":[");
+    char *downloadUrl = NULL;
+    if (assetsStart) {
+        // Find assets and look for noteplus.exe specifically
+        char *asset = assetsStart;
+        while ((asset = strstr(asset, "\"name\":\"")) != NULL) {
+            asset += strlen("\"name\":\"");
+            char *nameEnd = strchr(asset, '\"');
+            if (!nameEnd) break;
+            *nameEnd = '\0';
+            if (strcmp(asset, "noteplus.exe") == 0) {
+                // Found noteplus.exe, now find browser_download_url
+                char *urlAsset = strstr(nameEnd + 1, "\"browser_download_url\":\"");
+                if (urlAsset) {
+                    urlAsset += strlen("\"browser_download_url\":\"");
+                    char *urlEnd = strchr(urlAsset, '\"');
+                    if (urlEnd) {
+                        *urlEnd = '\0';
+                        downloadUrl = _strdup(urlAsset);
+                        break;
+                    }
+                }
+            }
+            asset = nameEnd + 1;
+        }
+    ]```
mint storm
mint storm
#

i don't know what you changed or whatsoever

#

i didn't read your code

blazing vector
#

that previous one is cancerous

mint storm
#

what are you even trying with that

blazing vector
mint storm
#

by doing what exactly?

blazing vector
blazing vector
mint storm
#

wasn't your problem the redirect?

blazing vector
#

vscode kinda does it like that in some ways

blazing vector
mint storm
#

how does that solve it?

blazing vector
#

i am just trying different ways to solve it

#

but yeah my issue is ith the redirect

mint storm
#

what

blazing vector
#

is this an issue or just a best practice related topic

mint storm
#

how would that solve your problem

mint storm
blazing vector
#

in the gh asset yes

mint storm
#

maybe dont jump around multiple issues, that's very confusing

#

solve one issue and then the next

blazing vector
#

how to solve the first one

blazing vector
#

right?

#

i don't get it lol

blazing vector
#

like

#

follows redirects to get the actual location from the "new" field in
the response headers.

#

?

#

if yes i did try that and it didn't work

mint storm
#

what's the problem?

blazing vector
#

can't download the file

blazing vector
#

this one that gets invoked

#

hm

#

@mint storm

#

i got it working

#

but

mint storm
#

but what?

blazing vector
#

but overwrites the existing exe

#

is fucked up

mint storm
#

sure

blazing vector
mint storm
#

so how are you planning to solve that?

blazing vector
#

i used the CopyFileW

#

but uh

#

:\

mint storm
#

currently you have a noteplus.exe that is opened and you download a new version of it and you want to replace the old one with the new one

#

think of a possible solution

#

do you understand why it's currently technically not working?

blazing vector
#

a batch injection code

#

that kills the obsolete exe

#

and replaces with the new one

mint storm
#

something like that is a possible solution yeah

blazing vector
shell dirgeBOT
#

@blazing vector has reached level 5. GG!

blazing vector
#

but it works like shit

mint storm
#

whats the problem?

blazing vector
#

it still corrupts

#

it

mint storm
#

why?

#

and how?

blazing vector
# mint storm and how?
sprintf(batchContent,
        ":loop\n"
        "tasklist /FI \"IMAGENAME eq noteplus.exe\" | find /I \"noteplus.exe\" >nul\n"
        "if not errorlevel 1 (\n"
        "    timeout /t 1 /nobreak >nul\n"
        "    goto loop\n"
        ")\n"
        "move /Y \"%s\" \"%s\"\n"
        "start \"\" \"%s\"\n"
        "del \"%%~f0\"\n",
        tempExe, exeA, exeA
    );```
mint storm
#

what do you do with it?

blazing vector
#

in temp files

mint storm
blazing vector
#

i am trying something with tasklist

blazing vector
#
  • Downloads exe from temp
#
  • batch inject to force kill the app and copies the nw one
#
  • delete traces
#

the batch doesn't even get executed

#

the problem is it's downloading FINE

#

the copying is corrupted

#

its like

#

i t copies half of it

#

i am going insane

#

i swear

#

THE APP IS JUST A FEWJBS

#

@mint storm pls help

#

i get hit with compatibility error

mint storm
#

does it work when you download it through your browser from gh?

blazing vector
mint storm
#

copying from noteplus_new.exe to noteplus.exe?

blazing vector
#

but it renames it

#

yk

mint storm
blazing vector
#

it copies it wrong

blazing vector
#

@mint storm

blazing vector
#

@silver crystal can u please help me with installation process?

shell dirgeBOT
#

@blazing vector has reached level 6. GG!

blazing vector
#

I fixed the download process

silver crystal
#

what's the issue

#

@blazing vector also do not ping people for help

blazing vector
#

The script i made doesn't copy the updated exe properly

blazing vector
#

😭

#

another day to go without getting help

silver crystal
#

can you explain what your issue is?

blazing vector
silver crystal
#

I'm going to need more info than that, there's literally nothing I could do or say only based on that info

silver crystal
silver crystal
# blazing vector

big code snippets should be shared using pastebin/git or some other kind of online sharing service

silver crystal
#

why not?

blazing vector
silver crystal
#

you got ipban on every online sharing service that exists?

blazing vector
#

let me send u the file from my gh repo

silver crystal
#

alright, so what's the issue

blazing vector
silver crystal
#

what have you tried so far

blazing vector
#

tried making the exe writes new bin date by itself and reboots but it was worse

#

the file size gets huge

#

1gb exe

silver crystal
#

have you tried running the batch manually or running the commands by hand?

blazing vector
#

but it still gives corrupted exe

silver crystal
#

alright then your issue is not with your code it's with your commands

#

did you try the .bat or the commands?

blazing vector
silver crystal
#

can you show the commands you ran exactly

blazing vector
silver crystal
blazing vector
blazing vector
#

bu t ran directly

silver crystal
blazing vector
#

but instead of tasklist it's tasskill

silver crystal
blazing vector
blazing vector
silver crystal
blazing vector
#

the windows's temp folder

silver crystal
#

have you tried just running move /Y "C:\path\temp.exe" "C:\path\noteplus.exe"

silver crystal
#

and that doesn't work either?

blazing vector
silver crystal
#

I have a hard time believing that

#

maybe you can record a video

blazing vector
silver crystal
#

?

#

maybe we can spot what's wrong

shell dirgeBOT
#

@blazing vector has reached level 7. GG!

silver crystal
#

@blazing vector don't upload binaries here

blazing vector
#

i am setting to record a video

silver crystal
#

that's fine

blazing vector
silver crystal
#

I just tried the command and it worked for me

blazing vector
#

😐

#

(can't be executed)

silver crystal
#

ok but I don't know what you did to get that

blazing vector
silver crystal
blazing vector
#

i am having a doubt with my download method ...

silver crystal
silver crystal
#

lmao

#

then why do you think the move is the issue?

blazing vector
#

the size

#

the updated exe size is 282 kb

silver crystal
#

what about the size

blazing vector
#

the one in release is just a bit smaller

silver crystal
#

I don't know what you are talking about

silver crystal
#

ko is not the same as kb

blazing vector
#

ah yeah right

blazing vector
silver crystal
blazing vector
silver crystal
silver crystal
blazing vector
#

the updater works?

silver crystal
#

copy it to C:\path

#

run it

#

rename to temp.exe

#

run move /Y "C:\path\temp.exe" "C:\path\noteplus.exe"

#

run it again

#

and it worked

blazing vector
#

no

#

there is still an issue

#

the downloaded exe file that is from cache is corrupted

silver crystal
#

the issue is probably with the downlaod then

#

not the copy command

blazing vector
#

yes

#

i don't know what's the issue

silver crystal
#

so what's the generated link?

#

that you actually download

blazing vector
silver crystal
blazing vector
#

but it's htmurl obj

silver crystal
#

idk what that means

blazing vector
blazing vector
blazing vector
silver crystal
blazing vector
silver crystal
#

fix the url lol

blazing vector
silver crystal
blazing vector
#

i followed the gh docs 😭

silver crystal
blazing vector
silver crystal
blazing vector
#

i constructed it manually ;-;

#

hold on

silver crystal
#

I don't see where it tells you how to construct a download URL

silver crystal
blazing vector
#

oh

blazing vector
blazing vector
silver crystal
blazing vector
#

like, it doesn't show that the bbuild is successful

#

it just show Building Noteplus and then exits

silver crystal
#

that's horendous

blazing vector
#

ohh ifixed it

#

but uhhh

#

howto deal with broken pipe error from windres