Error trying to create file in OneDrive directory instead of local user drive - inno-setup

My installer includes lines for adding folders and files to the {userdocs} area.
Source: "FolderName\*"; DestDir: "{userdocs}\{#MyAppName}\FolderName"; Flags: ignoreversion recursesubdirs
However, some users have received an error while installing.
"An error occurred while trying to create a file in the destination directory:
Setup was unable to create directory "C:\Users\[username]\OneDrive\?????????
Error 123: The filename, directory name, or volume label syntax is incorrect."
Why is the installer trying to install on OneDrive rather than the local folder? It may be that the OneDrive account is full, but why would that prevent the completion of the installation locally? Is it possible for {userdocs} to return a OneDrive folder?

Related

Inno Setup can't handle Source path with space

my application has this directory that I need to include in the install package:
bin\Win Files\*
So, in the [Files] section, I have this line:
Source: "bin\Win Files\*"; DestDir: "{app}\bin\Win Files"; Flags: ignoreversion; Permissions: everyone-modify
But at compile time, it keeps saying it can't find that directory due to space in the path, the exact error message is:
No files found matching "C:\dev\packages\MyApp\bin\Win Files\*"
I've tried the following, all failed:
Source: """bin\Win Files\*"""
Source: "\"bin\Win Files\*\""
Source: '"bin\Win Files\*"'
That directory has to be named like that, so what should I do?
I use this:
[Files]
; Main application
Source: "{#SourceDir}\*"; DestDir: "{app}\"; Flags: recursesubdirs ignoreversion;
to copy all my files in one go to the installer. Note the recursesubdirs flag. I think spaces in the path (referenced here in the variable named SourceDir) are not actually a problem here.
This is due to the misunderstanding about the directory/file structure scanning mechanism in Inno Setup.
First of all, as #Martin Prikryl pointed out, one can include path that has space in it.
I think the following two rules are the key to this issue:
One cannot specify a folder that has no standalone files (e.g. empty folder or a folder that only has sub-directories). In my case: I have the following file structure per this question:
bin\Win Files\Libs\
bin\Win Files\Plugins\
So Source: "bin\Win Files\*"; will fail. If there is at least one standalone file under the "bin\Win Files\" folder, then the source line will work.
Inno Setup requires each folder be explicitly specified in the [Files] section as below:
Source: "bin\Win Files\Libs\*"; DestDir: "{app}\bin\Win Files\Libs";
Flags: ignoreversion; Permissions: everyone-modify
Source: "bin\Win Files\Plugins\*"; DestDir: "{app}\bin\Win Files\Plugins";
Flags: ignoreversion; Permissions: everyone-modify
as Source: "bin\Win Files\*"; will NOT include the sub-directories automatically, it is only used to include the standalone files under the bin\Win Files\ folder.

Installing MS SQL Server Express 2017 with Inno Installer

I'm desperately trying to install SQL Server Express 2017 with Inno Installer.
Within my installer I include the extracted installer files.
That means that I already executed the common SQLEXPR_x64_ENU.exe, to avoid the "extract-temp-folder" prompt while my installer is running.
I execute the following on the cmd:
{somePath}\SQLEXPR_x64_ENU\setup.exe /ACTION=Install /Q /SKIPRULES=RebootRequiredCheck /SUPPRESSPRIVACYSTATEMENTNOTICE=1 /IAcceptSQLServerLicenseTerms=1 /SECURITYMODE=SQL /SAPWD=secretPW /ConfigurationFile=ConfigurationFileExpr.ini
The install succeeds.
But when I do the same within my InnoInstaller-File like this:
...
[Files]
Source: "SQLEXPR_x64_ENU\*"; DestDir: "{tmp}\SQLEXPR_x64_ENU"; Check: not SQLExpress_Check; Flags: recursesubdirs;
[Run]
Filename: "{tmp}\SQLEXPR_x64_ENU\setup.exe"; Description: "Installing SQL Server Express 2017..."; StatusMsg: "Installing SQL Server Express 2017..."; \
Parameters: "/ACTION=Install /Q /SKIPRULES=RebootRequiredCheck /SUPPRESSPRIVACYSTATEMENTNOTICE=1 /IAcceptSQLServerLicenseTerms=1 /SECURITYMODE=SQL /SAPWD=secretPW /ConfigurationFile=ConfigurationFileExpr.ini"; Check: not SQLExpress_Check; Flags: runascurrentuser;
...
SQL Installer fails with the following error:
Exception type: System.MissingMethodException
Message:
Method not found: 'Void Microsoft.SqlServer.Chainer.Infrastructure.RoleService.Initialize(Microsoft.SQL.Chainer.Product.RolesType)'.
HResult : 0x80131513
Data:
DisableWatson = true
Stack:
at Microsoft.SqlServer.Configuration.BootstrapExtension.InitializeRoleServiceAction.ExecuteAction(String actionId)
at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)
Is this a permission error?
I do not have a clue.
On cmd-shell it works, but not on InnoInstaller.
Thanks in advance for your efforts and have a nice day.
Solution for me was provided by Gavin Lambert on the Inno Setup Forum :
If you're [installing from the directory of unpacked files], you need to use {sd}\shortname as the DestDir (usually combined with deleteafterinstall) -- you can't put the files in {tmp} or any similar path as the files are very deeply nested and the db installer ends up failing to access some files because the path is too long.
If you use an unpacked installer file, here is what should work absolutely perfect.
SQLEXPR_x64_ENU.exe /x:%temp%\SQLEXPR_x64_ENU\ /QS /ACTION=Install /SKIPRULES=RebootRequiredCheck /SUPPRESSPRIVACYSTATEMENTNOTICE=1 /IAcceptSQLServerLicenseTerms=1 /SECURITYMODE=SQL /SAPWD=secretPW /ConfigurationFile=ConfigurationFileExpr.ini
In the above command, /x:%temp%\SQLEXPR_x64_ENU\ is the very important switch where it describes the extraction location and with combination to /QS it will show you the progress on screen but will not ask for any input.
You may have to change %temp% to appropriate command to grab a windows temporary folder in your installer. The command I have posted is good for command-line execution.
Enjoy! :)

Startup folder shortcut not created

Here's part of my inno setup script:
[Setup]
PrivilegesRequired=admin
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
When i open the startup folder Win+R and type "shell:startup", there is no such folder created after the setup completed. The normal Program folder is created though. As I understand, to modify commonstartup, requires admin privilege and I have added this entry in Setup, but still not working. Anybody have any idea why and how to fix this?
EDIT: ok i tried with {userstartup} then it works. so my question is why the commonstartup one can't work?
The shell:startup opens user's "startup" folder, not the common one.
To open the common one, use shell:common startup.

Recursive setting of folder permissions with InnoSetup

I have a folder tree that I copy to C:\ProgramData The software that I am installing (don't blame me for this, I did not architect, write or design it) requires full control for everyone for this data.
So I put the following line in [Files] sectionL
Source: "C:\ProgramData\PFPS\MapDataServer\*"; DestDir: "C:\ProgramData\PFPS\FalconViewCommand"; Flags: ignoreversion createallsubdirs recursesubdirs; Permissions: everyone-full; Excludes: "*.LDF"
yes, this does give everyone full control of each individual file, but the program needs to create files and the folder permissions (directory) are not set for everyone.
I tried to add a [Dirs] section but that did not work:
[Dirs]
Name: "C:\ProgramData\PFPS\FalconViewCommand"; Flags: uninsalwaysuninstall; Permissions: everyone-full
What do the guru's say?
This works for me:
[Dirs]
Name:"{app}\"; Permissions:everyone-modify
What I have been doing is the following RUN at the end, I was finding that the Dirs was not working (yes, I always do a full unistall, when testing install scripts), otherwise how do you know what will happen when the product ships?
I agree with you about {commonappdata} but I am trying to remove randomness till I get to the bottom of the issue.
Here is what I have been trying:
[Run]
Filename: "C:\Windows\System32\icacls.exe"; Parameters: "C:\ProgramData\PFPS\FalconViewCommand /grant:r Users:(OI)(CI)F"; WorkingDir: "{tmp}"; Description: "Changing Directory Permissions"; StatusMsg: "Changing Directory Permissions"

Inno Setup is not including any of indicated files in destination folder

This is the first time I've used an installer program other than Access Developer Extensions. I have couple of MS Access files I'm trying to have installed into the user's AppData\Local folder. The only thing it will seem to do is put two files in that folder: unins000.exe and unins000.dat. It seems to ignore the files I want put in there, although when I compile it's definitely including them in the Setup.exe file. Here is the script - can someone tell me what could be wrong here? It doesn't seem to matter if the destination folder or files exist or not - I get the same result.
; -- LEAP.iss --
[Setup]
AppName=LEAP
AppVersion=1.1
DefaultDirName={localappdata}\LEAP
DefaultGroupName=LEAP
Compression=lzma2
SolidCompression=yes
OutputDir=userdocs:Inno Setup Output
[Files]
Source: "China.accdb"; DestDir: "{localappdata}"; DestName: "China.accdr"
Source: "Replica of China_be.mdb"; DestDir: "{localappdata}"
[Icons]
Name: "{group}\LEAP"; Filename: "{localappdata}\China.accdr"
Name: "{userdesktop}\LEAP"; Filename: "{localappdata}\China.accdr"
You want to replace {localappdata} with {app} in the [Files] and [Icons] sections. The {app} constant is defined once the user selects the install location on the "Select Destination Location" wizard page. Your end-users might not appreciate that you've allow them to choose a location to install your program, only to find out that you've actually hard-coded that location in the installer.
If you don't want them to choose a location, then set DisableDirPage=true in [Setup].
You should also establish an AppID value in [Setup].

Resources