Question

I have created one Windows Forms application and published it using ClickOnce. It generated the setup file with application files and it working good with update checking also.

But in "Application Files" folder it displaying the deployed files of all the DLL files I have used. There is no point in showing those dll names to user, and I don't want to reveal those DLL files I have used. So is it possible to give only the setup file to user and which perform as it performed before?

I'm using Visual Studio 2013 express edition (desktop). Or another way then ClickOnce? But I found ClickOnce is best .

I have tried Ilmerge, but it's not merging Sqlite.Interop.dll and is throwing an error. After researching much I found that the issue is with SQLite itself.

Was it helpful?

Solution

You should create a wrapper setup around ClickOnce.

  • Extract all files to temp dir
  • Run Setup.exe from temp dir

I use InnoSetup for this purpose, which is open Source

A basic setup could look like this:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "..."
#define MyAppVersion "1"
#define MyAppPublisher "..."
#define MyAppURL "http://..."
#define MyAppExeName "setup.exe"

[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={{...-...-...-....-.........}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=no
LicenseFile={#SourcePath}resources\license.txt
OutputDir={#SourcePath}setup\disk
OutputBaseFilename=setup
SetupIconFile={#SourcePath}resources\app.ico
WizardImageFile={#SourcePath}resources\app.bmp
WizardSmallImageFile={#SourcePath}resources\app.bmp
Compression=lzma
SolidCompression=yes
Uninstallable=no
DisableFinishedPage=yes
;PrivilegesRequired=none

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"

[Files]
Source: {#SourcePath}files\*; DestDir: "{tmp}"; Flags: ignoreversion

[Run]
Filename: {tmp}\setup.exe; Parameters: "install"

Note: {#SourcePath}files\* should point to the directory where your setup.exe / MyApp.application files and the Application Files folder live. Not testet but should give your a good start.

The result is a single exe file that includes everything you need. Don't forget to clean the ClickOnce directory before creating a new setup otherwise the Application Files folder will contain the last version, too.

OTHER TIPS

Since I've found a few improvements to the above, I'm posting this for anyone following.

The above code works pretty well but it's worth noting the following things:

You may need to change the references to {tmp} in the code given above. InnoSetup deletes the {tmp} folder once the installation is finished and for me this was causing the ClickOnce setup to crash with missing file errors.

Also might want to think about adding: Flags: "postinstall" after Parameters: "install"; My application wasn't allowing drag and drop when launched from InnoSetup until I added this.

Finally, I had to explicitly list each folder in the tree structure in the files section. Using * did not preserve this when copying to the destination folder (either that or it completely ignored folders when copying). There may be an InnoSetup option/flag to make this work but I didn't investigate it.

[Files]
Source: "{#SourcePath1}\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourcePath1}\Application Files\MyApp\*"; DestDir: "{app}\Application Files\MyApp"; Flags: ignoreversion
Source: "{#SourcePath1}\Application Files\MyApp\Resources\*"; DestDir: "{app}\Application Files\MyApp\Resources"; Flags: ignoreversion
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top