Yes, the “You” in the path should be replaced with the actual account name for the user.
I generally prefer to have the app itself create (or copy) the DB to AppData. If you wanted the installer to do it, I suspect it would involve the same types of Source/DestDir settings.
That line runs on your machine when you build the installer, not on the end user’s machine when they install. It identifies where to find the source files on your machine. Note that you will also need to replace “XojoApp” with the actual name of your app. You might have to replace the entire path if you’re building somewhere else.
You need to replace “XojoApp” and any path that begins with “C:”. The paths are where you compiled the app on your machine. They may be vastly different, especially if you’ve turned off the option to use the build directory.
[code]; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{DBF2254A-F176-4FD9-9922-C33F2C340622}
AppName=Classes Selection
AppVersion=1.0
;AppVerName=Classes Selection 1.0
AppPublisher=Arnold Acres Design
AppPublisherURL=http://www.arnoldacres.co.nz
AppSupportURL=http://www.arnoldacres.co.nz
AppUpdatesURL=http://www.arnoldacres.co.nz
DefaultDirName={pf}\Classes Selection
DisableDirPage=yes
DefaultGroupName=Classes Selection
DisableProgramGroupPage=yes
OutputDir=C:\Users\cliffgs\Desktop
OutputBaseFilename=Classes Setup
Compression=lzma
SolidCompression=yes
The Installation program works perfectly if I am prepared to put the database file manually into the AppData folder, but that is not an option because some remote people may have to install this, and they may not know how to get to their AppData folder. (I have tried in this script putting the database file in the app folder, but that doesn’t seem to work either.
Sorry to reply to myself. But on reading the previous post I guess I am putting the database file directly in the app folder. I will attempt to change that to where I have it installed in the Xojo Project and where I am targeting it in the program.
I had already tried that, it gave an error (Unknown constant). I found in the docs {userappdata), that didn’t give any errors in the script, but it also didn’t load the database file into AppData.
I can get the installer program to work and actually install the program, except for the database file. I think I will quit while I’m ahead and have the installer create the program and the user can manually put the database fill in their own AppData folder. This program is for a club, and I know most of the members of the club - I am sure I can give explicit enough details on how to do that small job.
Just as a final question, would it be OK to stuff the database file inside the
Many thanks for all your help Tim I don’t want to waste any more of your time (or mine). Perhaps later I will have more time to study InnoSet more closely and try and resolve this issue.
If you can get the installer to stick the database next to the app, then you can copy the database into ApplicationData if it doesn’t already exist there. (Paul’s suggestion)
I had a quick look at the Eddies Electronics sample project that came with Xojo. I noticed that the two database files were in the same folder as the xojo binary file.
So I put my database in the same file as my xojo binary file, built the app for Windows and then set up InnoSetup. After installing the app, it started without complaining it couldn’t find the database and so worked! When I looked inside the folder in Program Files the database is sitting in that folder along with the app.
I really don’t care where this file is as long as the program works (which it does now) so I am going to leave it there without trying the move it to the ApplicationData folder.
Thank you so much for your help. My first program in Xojo and first ever that I have written for Windows is now working.
f=SpecialFolder.SharedApplicationData
If f <> Nil Then
app.helpString=f.AbsolutePath + webAdd + "\"
app.cnnStr = f.AbsolutePath + webAdd + "\" + dbName
Else
MsgBox("The configuration file is missing.")
End If
webAdd is the name of the directory in c:\ProgramData where I put the database