Is there a way to permanently install folders that are setup in the installation? Our situation is we install a number of folders, about 20, with subfolders, but do not want to uninstall or remove any content if the software is uninstalled.
I thought about putting a "dummy" permanent file in lowest level of each folder, but that seems like a cludge. The other thought is to move the folder creation out of the region for install and update, but that looks like it removes the ability to use the interface for modifying the install. The third option, which I do not see anyway to do, is to put an "if" statement in front of the folder creation, so that if an uninstall is running, do not remove. I like the last option the best, but do not see how to do this.
Thanks,
Jeff
Permanent install of folders
-
- Posts: 6
- Joined: Tue May 23, 2006 3:27 pm
- Location: Ohio
You may want to try using the Call DLL function and calling "CreateDirectoryA" in the Win32 API before any Install Files command, that way the folders exist before the windows installer engine creates them therefore they should not be removed on uninstall.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
-
- Posts: 6
- Joined: Tue May 23, 2006 3:27 pm
- Location: Ohio
Calling dll
I have not been able to get the call dll function to work. I am using the following inputs:
dll path: C:\\WINNT\\system32\\Kernel32.dll (as well as just Kernel32.dll)
function name: CreateDirectoryA
type: pointer to string
value: c:\\test2
type: pointer to long
value: 0
I have tried a couple of different options, do you have any suggestions?
Thanks,
Jeff
dll path: C:\\WINNT\\system32\\Kernel32.dll (as well as just Kernel32.dll)
function name: CreateDirectoryA
type: pointer to string
value: c:\\test2
type: pointer to long
value: 0
I have tried a couple of different options, do you have any suggestions?
Thanks,
Jeff
Is your return type a BOOL?
If that fails and you really want the folders to be permanent write out batch file or windows script file that creates the directories for you and use Run Program.
The simplest solution is to install a 0 byte permanent file in each of the folders you want to make permanent.
If that fails and you really want the folders to be permanent write out batch file or windows script file that creates the directories for you and use Run Program.
The simplest solution is to install a 0 byte permanent file in each of the folders you want to make permanent.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
-
- Posts: 6
- Joined: Tue May 23, 2006 3:27 pm
- Location: Ohio
permanent folders
Yes, my return type is a bool. I have not been able to get the call dll to work for any dll's either.
I already did the 0 byte file in the folders to keep, and marked the files as permanent, that just seems like a really "hokey" solution.
Thanks for the input tho.
I already did the 0 byte file in the folders to keep, and marked the files as permanent, that just seems like a really "hokey" solution.
Thanks for the input tho.
I use the Call DLL functin quite extensively in my packages for deleting files and setting the current working directory with no problems, to venture a guess I would say that the problem with the CreateDirectoryA Win API call has to do with what is passed in SECURITY_ATTRIBUTES.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Try this:
This creates c:\\temp\\test. For it to work, c:\\temp must exist (the API does not create folders "recursively").
Code: Select all
~InstallAware Clipboard Data~
~Call DLL Function~
~{EB5C7937-5FCC-44CA-964B-FCDA05E5206C}~
~kernel32.dll,CreateDirectoryA,bool,,"pointer to string",c:\\temp\\test,"double word",0,$~
~mIDEFunc.dll\\mEXEFunc.dll~
This creates c:\\temp\\test. For it to work, c:\\temp must exist (the API does not create folders "recursively").
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 181 guests