Accessing loose files from Windows Installer - installation

I've built a .msi Installer which has some 'loose files' ie files not in the .msi
For simplicity, assume I have:
Installer.msi
AFile.txt
It works fine if run from a regular folder that contains the Installer + loose file.
But if its from a Zipped folder (Archive.zip), Windows quietly unzips to a Temp folder before running the .msi installer. The installer then can't find the loose files its looking for because its being run from some random place in the Temp folder. I get an error:
Source file not found:
C:\Users\testing\AppData\Local\Temp\Temp1_Archive.zip\AFile.txt
Is there any way of building an Installer that can determine where its been unpacked to? Or somehow say the loose file is in the same folder as the .msi?

Related

Visual Studio installer project - keep file while uninstall

I am using Visual Studio Installer Projects to generate MSI files, it includes create log folder when it doesn't exist. When uninstall the program, that log folder and files inside will also deleted. Is there a way to keep those log folder and files during uninstall?

How to delete installation directory when program is uninstalled by visual studio installer project?

I have created an installer using visual studio 2010 installer project. The program installs correctly and works fine for all the features.
But the problem is in uninstallation, when I uninstall the program it does not delete the application directory from file system but deletes the contents of it.
Suppose I am installing the program in C:\Program Files\MyApp, it deletes the contents of MyApp folder but doesn't delete the folder it self.
Any way to do this? If there is a way then how to do this?
Does your application create files in this directory after it's been installed? If so, you might want your app to move that user-data to a more user-data-centric location like %PROGRAMDATA% so that application files and user-data are separated.
It also helps to make sure uninstall cleans up everything, and it's easier to persist user-data across upgrades.
Relevant thread - http://www.itninja.com/question/delete-folders-after-uninstall

Make installer use local .msi file

I'm using a Visual Studio Installer Project (.vdproj) to create an installer. When built, it outputs an .msi file and a setup.exe file. When I run the setup.exe, it downloads the .msi from the location specified in the "Installation URL" field in project build properties, and runs it. However, if the PC is offline, the download fails and the install is aborted, although the .msi file is present in the same directory as the .exe file. Is it possible to configure the setup.exe to use the local .msi file if present?
In the Visual Studio Prerequisites you should be able to use the "Download Prerequisites from the same location as my application". This generates a directory (a CD image if you like) that will be used to install the prerequisites. It won't install anything from there unless you build the prerequisites that way. Also, you can't just add a framework with the right name because there's a hash check to ensure that the actual prerequisite redistributable is the correct one.

installshield launch exe from source media

I have an installshield msi project that produces CD-ROM files.
I know how to set a custom action in order to launch an exe file stored in binary table.
What i want to do is to launch an exe file that is at the source media root directory and it is not copied at the installation directory.
I do not want to add it at the binary table because i want to be able to change the file without building again the installer.
any ideas?
Thanks
For first time installation, you can reference a property that indicates the location of the installation files. Common ones to consider include:
SETUPEXEDIR
SOURCEDIR
OriginalDatabase - watch out for the .msi filename being included here.
For InstallScript installations (instead of Windows Installer based ones), there is also PACKAGE_LOCATION.

Cannot add folders and files to Windows Installer package

I' m using Visual Studio to create windows installer package, i can't add the folders and data files needed for the application. I create the folders needed for the application in the 'application folder'(under 'File System on Target Machine'), then add files into the appropriate folders, and when i install the application and go to the installation folder there are no folders...there is only the application exe file, hm...
Ooops, i forgot to put the files in the folders actually, that was the problem, so if the folder is empty it is not created in the installer package.

Resources