Video Screencast Help

Files not in exe.

Created: 16 Oct 2012 | 3 comments

Welcome. I once saw a setup where some files were not hidden in the exe file, but just sitting in a folder and then copied the installer it. How do such a thing?

polish: Witam. Widziałem kiedyś instalator w którym niektóre pliki nie były ukryte w pliku exe lecz poprostu siedziały w folderze a później instalator je kopiował. Jak takie coś zrobić?

Discussion Filed Under:

Comments 3 CommentsJump to latest comment

EdT's picture

Instead of using the "Install File" command, use the "Copy Local" command. The predefined variable %INST% holds the path of the Wisescript exe you are running, so you can parse this as necessary to work out the relative location of the file "source", and of course the destination is defined by %MAINDIR% or any similar variable you may be using to define the installation folder.

By the way, in the compile options, you will find there is a setting to make the EXE "ZIP Compatible".  There is one good reason for doing this - the compiled EXE includes the source wisescript, but this is not normally accessible in a standard compiled EXE. If you use a ZIP compatible EXE, you can then open the EXE in WinZip or any similar ZIP editor, and extract the embedded files including the WSE file. Useful if you ever lose the source, but also allows any user to extract your source code if they so wish. Just something to consider as a backup.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

BloodManXD's picture

OK so one more question how to do such a thing that the installer will delete the folder where the files (not the file itself but together with the folder)

pl: OK dzięki jeszcze jedno pytanie jak zrobić takie coś że instalator będzie usuwał folder w którym są pliki ( nie same pliki lecz razem z folderem )

EdT's picture

If the folder was created by your installation, then it should be removed during the uninstall. However, there are some situations where this cannot happen.

If, during uninstall, a file in the folder is "in use", then that file cannot be deleted, but instead, the operating system makes an entry in the "pendingfilerenameoperations" registry key which will cause the file to be deleted during the next reboot. Since the uninstall process is no longer running, the folder will remain.

If the folder was not created by your installer, then it can only be deleted if it is empty, and if I recall correctly, you need to handle this by adding lines into the installation logfile (there is a command for this).

There is no real documentation for this - the best way to figure out what to include in the installation log is to script an install with the necessary commands to delete a folder, and then see how this is recorded in the installation log.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.