I have an application available to users as a .zip file.
This contains just a single .exe file.
One user has reported that after extracting the zip file the application runs but then disappears after he closes it.
My first thoughts are that he is running the application from within the .zip folder.
Is there anyway to prevent this or check it has been attempted?
Regards
CD
Run In zip folder (Windows)
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Run In zip folder (Windows)
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Run In zip folder (Windows)
First thing your app should do is check for the presence of any accompanying files that get expanded with it. If they're not there, show a message and quit.
BERESHEIT
Re: Run In zip folder (Windows)
Maybe you can check ProgramFilename() against GetTemporaryDirectory()
If windos unzip a file on the fly, it stores it in the temp directory of the user.
Or simply: if the ProgramFilename() contains 'AppData\Local\Temp' than something is wrong.
If windos unzip a file on the fly, it stores it in the temp directory of the user.
Code: Select all
Debug GetTemporaryDirectory()
Debug GetPathPart(ProgramFilename())
Re: Run In zip folder (Windows)
Different unzipping tools will extract the files into different directories. PeaZip, for example, extracts to the same folder as the zip file (not to the system temp folder), so checking for %TEMP% or %APPDATA% in the path is not going to be reliable.
Netmaestro's answer is the correct solution.
Netmaestro's answer is the correct solution.
Re: Run In zip folder (Windows)
It also depends on how they received the .zip: if it was attached to an email and they opened it directly, then it disappears when the email is closed.
Advise your users never to work in an archive or in an attachment, but always extract to a folder before use.
Advise your users never to work in an archive or in an attachment, but always extract to a folder before use.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Run In zip folder (Windows)
Tried these and the checking for a temp folder seems to work ok.
Maybe best to create a self extracting zip for windows?
Windows and anti virus do seem to moan if you download an EXE file though.
Regards CD
Maybe best to create a self extracting zip for windows?
Windows and anti virus do seem to moan if you download an EXE file though.
Regards CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Run In zip folder (Windows)
Definitely not for PeaZip. Here's the path returned by PeaZip when running my exe inside it without extraction, when the zip file is on my desktop:collectordave wrote:Tried these and the checking for a temp folder seems to work ok.
Code: Select all
C:\Users\<name>\Desktop\.ptmp505719\
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Run In zip folder (Windows)
Hi
Yes, just to be sure, I am writing a small install program to download individual files and put them where they belong.
Seems easiest.
CD
Yes, just to be sure, I am writing a small install program to download individual files and put them where they belong.
Seems easiest.
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.