Update the installer

This commit is contained in:
qianlifeng
2014-12-29 21:55:27 +08:00
parent 890397bae7
commit ba0bda6aa6
12 changed files with 70 additions and 17 deletions

View File

@@ -29,11 +29,13 @@ Name: english; MessagesFile: compiler:Default.isl
Type: files; Name: "{commonstartup}\{#MyAppName}.lnk" Type: files; Name: "{commonstartup}\{#MyAppName}.lnk"
[Tasks] [Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons};
Name: startupfolder; Description: Startup with Windows; Name: startupfolder; Description: Startup with Windows;
[Files] [Files]
Source: {#MyAppPath}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs Source: {#MyAppPath}\*; Excludes: Plugins\*,Themes\*; DestDir: {app}; Flags: ignoreversion recursesubdirs
Source: {#MyAppPath}\Plugins\*; DestDir: {%USERPROFILE}\.Wox\Plugins; Flags: ignoreversion recursesubdirs
Source: {#MyAppPath}\Themes\*; DestDir: {%USERPROFILE}\.Wox\Themes; Flags: ignoreversion recursesubdirs
[Icons] [Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName} Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
@@ -42,4 +44,10 @@ Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: deskto
Name: {userstartup}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupfolder Name: {userstartup}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupfolder
[Run] [Run]
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent unchecked
[UninstallDelete]
Type: filesandordirs; Name: "{%USERPROFILE}\.Wox"
[UninstallRun]
Filename: {sys}\taskkill.exe; Parameters: "/f /im Wox.exe"; Flags: skipifdoesntexist runhidden

View File

@@ -46,9 +46,6 @@ namespace Wox.Core.Plugin
static PluginManager() static PluginManager()
{ {
pluginDirectories.Add(DefaultPluginDirectory); pluginDirectories.Add(DefaultPluginDirectory);
pluginDirectories.Add(
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"));
MakesurePluginDirectoriesExist(); MakesurePluginDirectoriesExist();
} }

View File

@@ -1,4 +1,5 @@
What does Wox.Core do? What does Wox.Core do?
=====
* Handle Query * Handle Query
* Loading Plugins (including system plugin and user plugin) * Loading Plugins (including system plugin and user plugin)

View File

@@ -69,7 +69,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="README.txt" /> <None Include="README.md" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Wox.Infrastructure\Wox.Infrastructure.csproj"> <ProjectReference Include="..\Wox.Infrastructure\Wox.Infrastructure.csproj">

View File

@@ -10,15 +10,32 @@ using Newtonsoft.Json;
namespace Wox.Infrastructure.Storage namespace Wox.Infrastructure.Storage
{ {
[Serializable] [Serializable]
public abstract class BaseStorage<T> : IStorage where T : class,IStorage,new() public abstract class BaseStorage<T> : IStorage where T : class,IStorage, new()
{ {
private readonly string configFolder = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Config"); private string configFolder;
private string ConfigFolder
{
get
{
if (string.IsNullOrEmpty(configFolder))
{
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
if (userProfilePath == null)
{
throw new ArgumentException("Environment variable USERPROFILE is empty");
}
configFolder = Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Config");
}
return configFolder;
}
}
protected string ConfigPath protected string ConfigPath
{ {
get get
{ {
return Path.Combine(configFolder, ConfigName + FileSuffix); return Path.Combine(ConfigFolder, ConfigName + FileSuffix);
} }
} }
@@ -72,9 +89,9 @@ namespace Wox.Infrastructure.Storage
{ {
if (!File.Exists(ConfigPath)) if (!File.Exists(ConfigPath))
{ {
if (!Directory.Exists(configFolder)) if (!Directory.Exists(ConfigFolder))
{ {
Directory.CreateDirectory(configFolder); Directory.CreateDirectory(ConfigFolder);
} }
File.Create(ConfigPath).Close(); File.Create(ConfigPath).Close();
} }

5
Wox.Plugin/README.md Normal file
View File

@@ -0,0 +1,5 @@
What does Wox.Plugin do?
====
* Define base objects and interfaces for plugins
* Plugin Author who making C# plugin should reference this DLL via nuget

View File

@@ -59,6 +59,9 @@
<Compile Include="Result.cs" /> <Compile Include="Result.cs" />
<Compile Include="ActionContext.cs" /> <Compile Include="ActionContext.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -8,7 +8,13 @@
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender"> <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="log.txt"/> <file type="log4net.Util.PatternString">
<converter>
<name value="WoxLogPathConverter" />
<type value="Wox.Helper.WoxLogPathConverter,Wox" />
</converter>
<conversionPattern value="%WoxLogPathConverter{log}\\log.txt" />
</file>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyyMMdd-HH:mm:ss"/> <datePattern value="yyyyMMdd-HH:mm:ss"/>

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Wox.Helper
{
public class WoxLogPathConverter : log4net.Util.PatternConverter
{
protected override void Convert(TextWriter writer, object state)
{
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
writer.Write(Path.Combine(userProfilePath, ".Wox"));
}
}
}

View File

@@ -37,6 +37,7 @@ using Path = System.IO.Path;
using Rectangle = System.Drawing.Rectangle; using Rectangle = System.Drawing.Rectangle;
using TextBox = System.Windows.Controls.TextBox; using TextBox = System.Windows.Controls.TextBox;
using ToolTip = System.Windows.Controls.ToolTip; using ToolTip = System.Windows.Controls.ToolTip;
using Wox.Infrastructure.Logger;
namespace Wox namespace Wox
{ {

View File

@@ -18,9 +18,6 @@ namespace Wox
static ThemeManager() static ThemeManager()
{ {
themeDirectories.Add(
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Themes"));
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE"); string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
if (userProfilePath != null) if (userProfilePath != null)
{ {

View File

@@ -104,6 +104,7 @@
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Helper\WoxLogPathConverter.cs" />
<Compile Include="ImageLoader\ImageCacheStroage.cs" /> <Compile Include="ImageLoader\ImageCacheStroage.cs" />
<Compile Include="Storage\UserSelectedRecordStorage.cs" /> <Compile Include="Storage\UserSelectedRecordStorage.cs" />
<Compile Include="ThemeManager.cs" /> <Compile Include="ThemeManager.cs" />