I’m trying to create an installer for a Microsoft Excel Add-In. The installer should also remove a file (if it exists) during the installation.
The file that I would like to remove is installed in Microsoft Excel’s folder “XLSTART” and the name of the file is: “Extension.xls”
My problem is that I can't seem to delete the file.
(I'm using AI 12.2.1 on a Win7 computer)
This is how I’m trying to do it.
- First I want to find out the installation path of Excel by reading from the registry.
So I have created a couple of “Searches”, one for each version of Excel (Excel 2013, Excel 2010 etc.)
I have named the searches: EXCEL_2013_PATH, EXCEL_2010_PATH etc.
So if Excel 2013 is installed, I then will have the path to Excel 2013 installation path in the variable: EXCEL_2013_PATH
EXCEL_2013_PATH = C:\Program Files (x86)\Microsoft Office\Office15\ - I then created another “Search”, based on the previous one.
This is a folder search, and it uses the variable EXCEL_2013_PATH and then adds the folder XLSTART at the end, which will result in the complete path to where the add-in currently might be installed.
I have named this “Search”: EXCEL_2013_XLSTART
EXCEL_2013_XLSTART = C:\Program Files (x86)\Microsoft Office\Office15\XLSTART
I think here is the first of my problems.
How can I make sure that the search “EXCEL_2013_PATH” is evaluated before my second search “EXCEL_2013_XLSTART” is evaluated?
When I run a “test” on all the “searches” it works, but looking in the logfile after I have ran the installation, it looks like the variables are evaluated in another order. - Next I would like to remove the file “Extensions.xls” from the “EXCEL_2013_XLSTART” folder if (it the file and folder exists)
I have created a “Property based” folder under “Files & Folders”, based on the property “EXCEL_2013_XLSTART” (which should contain the path to the folder)
I then try to remove my file, but the file doesn't gets deleted when I run the installer
Here I believe I might have a problem with rights. But I have tried creating the installer as a “Per User with administrator rights” but with no luck.
Kalle
FOLLOW US
Get the latest news in Application Packaging