I am developing an extension for ArcGIS 10.3 using ArcObjects in c# and it uses a database (.sdf). I want to setup the extension in such a way that when extension is installed (it is ArcGIS AddIn), it copy the .sdf file from the source folder to the user's folder (common location so that Extension in ArcGIS can access and read from there) in Windows 7.
closed as off-topic by PolyGeo♦ Mar 3 '16 at 2:14
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
You simply need to modify the following lines and save them into a batch file (for example install.bat).
copy e:\database\myDatabase.sdf %USERPROFILE%\AppData\Roaming\ProgramFolder
The first parameter is the source path of the database. The second parameter is the destination path. %USERPROFILE% stands for the current users home directory. You can modify the subdirectories the way you need. The second line in the batch script is:
Your operating system will know the file extension .esriaddin and start the installation.
For the uninstall you can find an answer here. You can add the described commands in an uninstall.bat and add the following line to delete the database afterwards: